:root {
  color-scheme: light;
  --bg: #f5f6f1;
  --surface: #ffffff;
  --surface-2: #eef2ec;
  --ink: #20231f;
  --muted: #687066;
  --line: #d8ded2;
  --line-strong: #bdc7ba;
  --teal: #08736f;
  --teal-deep: #075b58;
  --wine: #8a3446;
  --brass: #9f6b2f;
  --violet: #654a7b;
  --danger: #a13d32;
  --income: #08775b;
  --expense: #a04432;
  --shadow: 0 18px 45px rgba(37, 44, 34, 0.08);
  --radius: 8px;
  --sidebar: 292px;
  --icon-peak: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 19h18'/%3E%3Cpath d='M5 19l5-9 4 6 3-5 2 3'/%3E%3C/svg%3E");
  --icon-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11.5 12 4l9 7.5'/%3E%3Cpath d='M5 10.5V20h14v-9.5'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E");
  --icon-room: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h12l4 4v10H4z'/%3E%3Cpath d='M16 5v4h4'/%3E%3Cpath d='M8 19v-7h4v7'/%3E%3C/svg%3E");
  --icon-npc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4Z'/%3E%3Cpath d='M4 20c1.7-3.5 5-5 8-5s6.3 1.5 8 5'/%3E%3Cpath d='M9 9l1.5 1.5L14 8'/%3E%3C/svg%3E");
  --icon-finance: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='6' rx='6.5' ry='3.5'/%3E%3Cpath d='M5.5 6v6.5C5.5 14.4 8.4 16 12 16s6.5-1.6 6.5-3.5V6'/%3E%3Cpath d='M5.5 12.5V17c0 1.9 2.9 3.5 6.5 3.5s6.5-1.6 6.5-3.5v-4.5'/%3E%3C/svg%3E");
  --icon-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M4 9h16'/%3E%3Cpath d='M8 13h3M13 13h3M8 17h3M13 17h3'/%3E%3C/svg%3E");
  --icon-campfire: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3c1.5 2.3 1 3.9-.4 5.5 2.5-.5 4.9 1.1 5.7 3.7.9 2.8-.5 5.5-3 7.1-1.5 1-3.6 1.7-5.7 1.2-3-.7-5-3.3-5-6.4 0-2.6 1.7-4.9 4.1-5.9-.3 1.9.5 3.2 1.7 4.2C11.3 10.2 13 7.8 12 3Z'/%3E%3Cpath d='M7 20h10'/%3E%3C/svg%3E");
  --icon-journey: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4h10a3 3 0 0 1 0 6H7a3 3 0 0 0 0 6h11'/%3E%3Cpath d='M7 10v10h11v-4'/%3E%3Cpath d='M9 13h5M9 16h7'/%3E%3C/svg%3E");
  --icon-map: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 6 6-3 6 3 6-3v15l-6 3-6-3-6 3zM9 3v15M15 6v15'/%3E%3Ccircle cx='15' cy='11' r='2'/%3E%3C/svg%3E");
  --icon-missions: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3h8l2 3v15H6V6zM8 3v4h8V3M9 12h6M9 16h5'/%3E%3C/svg%3E");
  --icon-timeline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3v18M6 7h7l2-2 3 3-3 3-2-2H6M6 16h5l2-2 3 3-3 3-2-2H6'/%3E%3C/svg%3E");
  --icon-trophies: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4h8v5a4 4 0 0 1-8 0zM10 17h4M12 13v4M8 21h8M8 6H4v2a4 4 0 0 0 4 4M16 6h4v2a4 4 0 0 1-4 4'/%3E%3C/svg%3E");
  --icon-market: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h16l-1.2 12H5.2z'/%3E%3Cpath d='M8 8a4 4 0 0 1 8 0'/%3E%3Cpath d='M9 12h6'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3Cpath d='M19 12a7 7 0 0 0-.1-1l2-1.2-2-3.4-2.2.8a7 7 0 0 0-1.7-1l-.3-2.3H9.3L9 5.2a7 7 0 0 0-1.7 1l-2.2-.8-2 3.4 2 1.2a7 7 0 0 0 0 2l-2 1.2 2 3.4 2.2-.8a7 7 0 0 0 1.7 1l.3 2.3h4.4l.3-2.3a7 7 0 0 0 1.7-1l2.2.8 2-3.4-2-1.2c.1-.3.1-.6.1-1Z'/%3E%3C/svg%3E");
  --icon-edit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4l10-10-4-4L4 16z'/%3E%3Cpath d='M14 6l4 4'/%3E%3C/svg%3E");
  --icon-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M9 7V5h6v2'/%3E%3Cpath d='M7 7l1 12h8l1-12'/%3E%3Cpath d='M10 11v5M14 11v5'/%3E%3C/svg%3E");
  --icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}



* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(8, 115, 111, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(101, 74, 123, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
  /* Changing a grid track every frame forces the entire workspace to reflow. */
  transition: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  color: #f4f6ef;
  background: #242822;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: padding 340ms cubic-bezier(.22, .72, .22, 1), box-shadow 340ms ease, background 340ms ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-copy {
  min-width: 0;
  max-width: 190px;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  transition: max-width 260ms cubic-bezier(.22, .72, .22, 1), opacity 150ms ease, transform 240ms ease, visibility 0s linear;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  min-width: 54px;
  border: 0;
  border-radius: 0;
  color: #ffe3a7;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.brand-mark::before {
  display: none;
}

.brand p,
.brand span {
  margin: 0;
}

.brand p {
  font-size: 1.25rem;
  font-weight: 800;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: rgba(244, 246, 239, 0.68);
  font-size: 0.9rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: rgba(244, 246, 239, 0.78);
  background: transparent;
  text-align: left;
}

.nav-button > span[aria-hidden="true"] {
  width: 22px;
  color: rgba(247, 232, 197, 0.7);
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  white-space: nowrap;
  transition: max-width 240ms cubic-bezier(.22, .72, .22, 1), opacity 130ms ease, transform 220ms ease, visibility 0s linear;
}

.nav-button > span[aria-hidden="true"] {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: inherit;
  font-size: 0;
  line-height: 0;
  background: currentColor;
  -webkit-mask: var(--icon, var(--icon-home)) center / contain no-repeat;
  mask: var(--icon, var(--icon-home)) center / contain no-repeat;
}

.nav-button[data-view-target="dashboard"] > span[aria-hidden="true"] { --icon: var(--icon-home); }
.nav-button[data-view-target="rooms"] > span[aria-hidden="true"] { --icon: var(--icon-room); }
.nav-button[data-view-target="npcs"] > span[aria-hidden="true"] { --icon: var(--icon-npc); }
.nav-button[data-view-target="finance"] > span[aria-hidden="true"] { --icon: var(--icon-finance); }
.nav-button[data-view-target="calendar"] > span[aria-hidden="true"] { --icon: var(--icon-calendar); }
.nav-button[data-view-target="campfire"] > span[aria-hidden="true"] { --icon: var(--icon-campfire); }
.nav-button[data-view-target="journey"] > span[aria-hidden="true"] { --icon: var(--icon-journey); }
.nav-button[data-view-target="map"] > span[aria-hidden="true"] { --icon: var(--icon-map); }
.nav-button[data-view-target="missions"] > span[aria-hidden="true"] { --icon: var(--icon-missions); }
.nav-button[data-view-target="timeline"] > span[aria-hidden="true"] { --icon: var(--icon-timeline); }
.nav-button[data-view-target="trophies"] > span[aria-hidden="true"] { --icon: var(--icon-trophies); }
.nav-button[data-view-target="market"] > span[aria-hidden="true"] { --icon: var(--icon-market); }
.nav-button[data-view-target="settings"] > span[aria-hidden="true"] { --icon: var(--icon-settings); }

.nav-button:hover,
.nav-button.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.08);
}

.nav-button {
  transition: color 180ms ease, background 200ms ease, border-color 200ms ease, padding 280ms cubic-bezier(.22, .72, .22, 1), gap 240ms ease, transform 180ms ease;
}

.side-status {
  margin-top: auto;
  max-height: 240px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  transition: max-height 240ms ease, margin 240ms ease, padding 240ms ease, opacity 150ms ease, transform 240ms ease, border-color 180ms ease, visibility 0s linear;
}

.side-status div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.side-status span {
  color: rgba(244, 246, 239, 0.64);
  font-size: 0.84rem;
}

.side-status strong {
  color: #f8efdc;
  font-size: 0.94rem;
  text-align: right;
}

.workspace {
  width: 100%;
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 2rem;
  line-height: 1.1;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.day-control {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.day-control label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.day-control input {
  width: 120px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view[hidden] {
  display: none !important;
}

.notice,
.toast {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #e6c98f;
  border-radius: var(--radius);
  color: #624213;
  background: #fff6df;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: 360px;
  border-color: #b9d7cf;
  color: #0c4c46;
  background: #ebfbf6;
  box-shadow: var(--shadow);
}

.metric-grid,
.finance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
}

.metric.large {
  min-height: 120px;
}

.metric span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: 1.75rem;
  line-height: 1.05;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-start;
}

.panel {
  padding: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.9fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.dashboard-calendar-panel {
  min-height: 100%;
}

.calendar-mini {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  max-height: 780px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.calendar-mini-day {
  min-height: clamp(62px, 7.2vw, 86px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(205, 169, 106, 0.18);
  border-radius: 6px;
  color: inherit;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(218, 237, 248, 0.055), rgba(255, 255, 255, 0.016)),
    rgba(9, 17, 24, 0.86);
  cursor: pointer;
  overflow: hidden;
}

.calendar-mini-day:hover {
  border-color: var(--jade-line);
  background: rgba(22, 58, 55, 0.4);
}

.calendar-mini-day.today {
  border-color: var(--jade-line);
  box-shadow: 0 0 0 1px rgba(36, 103, 93, 0.32) inset;
}

.calendar-mini-day.has-entries {
  background:
    linear-gradient(180deg, rgba(218, 237, 248, 0.074), rgba(255, 255, 255, 0.022)),
    rgba(12, 23, 30, 0.92);
}

.calendar-mini-day header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.calendar-mini-day strong {
  color: #f7ecd3;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1;
}

.calendar-mini-day header span {
  color: rgba(243, 234, 216, 0.56);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  flex: 0 0 auto;
}

.calendar-mini-items {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.calendar-mini-dots {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 20px;
  min-width: 0;
  overflow: hidden;
}

.calendar-mini-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28) inset;
}

.calendar-mini-dot.income {
  background: #3fa77f;
  border-color: rgba(73, 150, 116, 0.54);
}

.calendar-mini-dot.expense {
  background: #c95f58;
  border-color: rgba(172, 88, 77, 0.58);
}

.calendar-mini-dot.event {
  background: #537fb8;
  border-color: rgba(77, 113, 160, 0.62);
}

.calendar-mini-empty {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(243, 234, 216, 0.12);
  border: 1px solid rgba(243, 234, 216, 0.08);
}

.calendar-mini-more {
  color: rgba(243, 234, 216, 0.52);
  font-size: 0.62rem;
  line-height: 1;
  margin-left: 2px;
  transform: translateY(1px);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin: 4px 0 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.section-header.floating {
  margin: 0 0 10px;
}

.section-header.lower {
  margin-top: 20px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row.compact {
  justify-content: flex-end;
}

.button.small {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.finance-balance-panel {
  margin-top: 14px;
}

.finance-balance-panel .inline-form {
  grid-template-columns: minmax(180px, 0.9fr) minmax(140px, 0.7fr) auto auto;
  margin-top: 0;
}

.setting-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.setting-readout span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.setting-readout strong {
  color: var(--ink);
  font-size: 1.25rem;
}

.button-row.separated {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.button {
  min-height: 40px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  color: #ffffff;
  background: var(--teal);
}

.button.primary:hover {
  background: var(--teal-deep);
}

.button.subtle {
  color: var(--teal-deep);
  border-color: #acd2ca;
  background: #edf8f5;
}

.button.ghost {
  color: var(--ink);
  border-color: var(--line-strong);
  background: transparent;
}

.button.danger {
  color: #ffffff;
  background: var(--danger);
}

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

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 115, 111, 0.13);
}

label {
  display: grid;
  gap: 7px;
  color: #42483f;
  font-size: 0.9rem;
  font-weight: 800;
}

.stacked-form {
  display: grid;
  gap: 13px;
}

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

.inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 140px 130px 110px auto;
  gap: 10px;
  margin-bottom: 16px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-line input,
fieldset input {
  width: auto;
  min-height: auto;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.two-column.wide-left {
  grid-template-columns: 1fr;
}

.form-panel {
  position: relative;
  top: 0;
}

.composer-body {
  margin-top: 14px;
}

.composer-body[hidden] {
  display: none !important;
}

.content-column {
  min-width: 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar.split {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 180px 180px 170px;
}

.room-grid,
.npc-grid,
.market-grid,
.source-list,
.list-stack,
.compact-stock,
.ledger-preview {
  display: grid;
  gap: 12px;
}

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

.room-grid > * {
  min-width: 0;
  max-width: 100%;
}

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

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

.market-sections {
  display: grid;
  gap: 16px;
}

.market-section {
  padding-top: 18px;
}

.room-card,
.npc-card,
.market-card,
.source-card,
.due-card,
.ledger-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.room-card,
.market-card,
.source-card,
.due-card,
.ledger-item,
.empty-state {
  padding: 14px;
}

.room-card {
  height: auto;
  min-height: 0;
  overflow: visible;
}

.room-card header,
.source-card header,
.market-card header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  margin-bottom: 10px;
}

.market-card-icon {
  width: 38px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  margin-top: 1px;
  border: 1px solid rgba(205, 169, 106, .28);
  border-radius: 50%;
  color: #dec898;
  background: rgba(8, 18, 23, .78);
}

.market-card-icon::before {
  font-family: var(--font-display);
  font-size: 1rem;
}

.market-card-icon.icon-potion::before { content: "◒"; }
.market-card-icon.icon-weapon::before { content: "†"; }
.market-card-icon.icon-armor::before { content: "◇"; }
.market-card-icon.icon-arcane::before { content: "✦"; }
.market-card-icon.icon-relic::before { content: "◆"; }

.market-card-icon + div {
  min-width: 0;
  flex: 1 1 auto;
}

.room-card h3,
.source-card h3,
.market-card h3,
.npc-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.room-card p,
.source-card p,
.market-card p,
.npc-card p,
.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.room-description-text {
  margin-top: 8px;
  color: rgba(235, 232, 219, 0.78);
  font-size: 0.94rem;
  line-height: 1.56;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: normal;
}

.room-bonus-text,
.room-usage-text {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(205, 169, 106, 0.18);
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: normal;
}

.room-bonus-text {
  color: #f2d8a0;
}

.room-bonus-text strong,
.room-usage-text strong {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-bonus-text strong {
  color: #f7e0a8;
  border: 1px solid rgba(205, 169, 106, 0.26);
  background: rgba(205, 169, 106, 0.12);
}

.room-usage-text {
  color: #d8e8f5;
}

.room-usage-text strong {
  color: #d8e8f5;
  border: 1px solid rgba(155, 187, 215, 0.24);
  background: rgba(155, 187, 215, 0.11);
}

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

.card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #f9faf7;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #465047;
  background: #f6f8f4;
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.chip.income {
  color: #07543f;
  border-color: #b7d9c9;
  background: #edf8f2;
}

.chip.expense {
  color: #7b2b22;
  border-color: #ecc6bf;
  background: #fff1ee;
}

.chip.premium {
  color: #5d3d77;
  border-color: #d8c7e7;
  background: #f7f0fc;
}

.chip.warn {
  color: #74500c;
  border-color: #ead5a5;
  background: #fff7e1;
}

.npc-card {
  overflow: visible;
}

.npc-card-body {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 0;
  align-items: stretch;
}

.npc-portrait {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 164px;
  color: #fbf5e7;
  background:
    linear-gradient(135deg, rgba(138, 52, 70, 0.92), rgba(8, 115, 111, 0.86)),
    #8a3446;
  font-size: 1.7rem;
  font-weight: 900;
}

.npc-portrait img {
  width: 100%;
  height: 100%;
  min-height: 164px;
  object-fit: cover;
}

.npc-info {
  min-width: 0;
  padding: 14px;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: normal;
}

.npc-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.npc-card .card-actions {
  margin-top: 12px;
}

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

.due-card strong {
  display: block;
  margin-bottom: 2px;
}

.due-card .amount {
  font-weight: 900;
  text-align: right;
}

.amount.income,
.type-income {
  color: var(--income);
}

.amount.expense,
.type-expense {
  color: var(--expense);
}

#view-finance {
  --finance-income: #64d5b1;
  --finance-expense: #ee947e;
  --finance-gold: #e8c675;
}
#view-finance > .two-column { grid-template-columns: minmax(0, 1fr); }
#view-finance .finance-summary .metric > span,
#view-finance .metric-head > span { display:flex; align-items:center; gap:9px; }
#view-finance #financeBalance,
#financeRecurringNet { color:var(--finance-gold); }
#view-finance #financeIncomeDue,
#financeRecurringIncome,
#view-finance .type-income { color:var(--finance-income); }
#view-finance #financeExpenseDue,
#financeRecurringExpense,
#view-finance .type-expense { color:var(--finance-expense); }
.finance-symbol { display:inline-block; width:20px; height:20px; background:var(--finance-gold); mask:var(--icon-finance) center/contain no-repeat; }
.finance-arrow { font-style:normal; font-size:1.3rem; }
.finance-summary .metric:nth-child(2) .finance-arrow { color:var(--finance-income); }
.finance-summary .metric:nth-child(3) .finance-arrow { color:var(--finance-expense); }
.finance-flow { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 0; margin-bottom:24px; border-block:1px solid var(--line); }
.finance-flow h2 { font-size:1.1rem; margin:0 0 4px; }
.finance-flow .muted { font-size:.8rem; }
.finance-flow dl { display:flex; flex-wrap:wrap; gap:24px; margin:0; }
.finance-flow dt { color:var(--muted); font-size:.75rem; }
.finance-flow dd { margin:5px 0 0; font-weight:800; }
#sourceList .source-card { border-left:3px solid var(--finance-income); padding:18px 20px; }
#sourceList .source-expense { border-left-color:var(--finance-expense); }
#sourceList .source-card h3 { font-size:1rem; margin-bottom:7px; overflow-wrap:anywhere; }
#sourceList .source-card p { font-size:.85rem; color:var(--muted); }
.source-status { font-size:.72rem; border:1px solid var(--line); padding:1px 8px; border-radius:12px; }
.source-status.is-active { color:var(--finance-income); background:#163b32; }
.source-dates { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.source-dates small { font-size:.73rem; color:var(--muted); }
.source-next { font-size:.75rem; color:var(--finance-gold); background:#c9a44914; border:1px solid #c9a44955; border-radius:12px; padding:3px 10px; }
#sourceList .card-actions { opacity:0; transition:opacity 140ms ease; }
#sourceList .source-card:hover .card-actions,
#sourceList .source-card:focus-within .card-actions { opacity:1; }
#ledgerForm { display:grid; grid-template-columns:minmax(160px,2fr) repeat(2,minmax(90px,1fr)) 70px minmax(110px,1fr) auto; align-items:end; gap:10px; margin-bottom:18px; }
#ledgerForm label { display:grid; gap:6px; min-width:0; font-size:.75rem; color:var(--muted); }
#ledgerForm input, #ledgerForm select { width:100%; min-width:0; }
.ledger-amount { font-weight:800; white-space:nowrap; }
@media (hover:none) { #sourceList .card-actions { opacity:1; } }
@media (max-width:1100px) {
  #ledgerForm { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #ledgerForm label:first-child { grid-column:span 2; }
  .finance-flow { align-items:flex-start; flex-direction:column; }
}
@media (max-width:600px) {
  #view-finance .finance-summary { grid-template-columns:minmax(0,1fr); }
  #ledgerForm { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .finance-flow dl { gap:16px; }
  #sourceList .source-card { padding:14px; }
}

.source-card {
  display: grid;
  gap: 8px;
}

.source-meta,
.market-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.ledger-panel {
  margin-top: 16px;
}

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

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td:last-child,
th:last-child {
  text-align: right;
}

#ledgerTable td[colspan] {
  text-align: center;
}

.market-controls {
  margin-bottom: 14px;
}

.market-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.market-settings {
  display: grid;
  grid-template-columns: 170px 170px minmax(190px, 1fr) minmax(260px, 1.1fr) auto;
  gap: 10px;
  align-items: end;
}

fieldset {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

legend {
  padding: 0 4px;
  color: #42483f;
  font-size: 0.82rem;
  font-weight: 800;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

.market-card {
  display: grid;
  gap: 10px;
}

.market-card .price-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.market-card .price-line span {
  color: var(--muted);
  font-size: 0.82rem;
}

.market-card .price-line strong {
  font-size: 1.12rem;
}

.market-link {
  color: var(--teal-deep);
  font-weight: 800;
  text-decoration: none;
}

.market-link:hover {
  text-decoration: underline;
}

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

.empty-state strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .two-column,
  .two-column.wide-left {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }

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

  .market-settings,
  .inline-form,
  .toolbar.split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

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

  .nav-button {
    justify-content: center;
    text-align: center;
  }

  .nav-button span {
    width: auto;
  }

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

  .side-status div {
    display: grid;
  }

  .side-status strong {
    text-align: left;
  }

  .workspace {
    padding: 18px;
  }

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

  .user-control {
    min-width: 0;
  }

  .day-control {
    align-items: stretch;
  }

  .metric-grid,
  .finance-summary,
  .room-grid,
  .npc-grid,
  .market-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .toolbar.split,
  .form-row,
  .inline-form,
  .market-settings {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .npc-card-body {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-status {
    grid-template-columns: 1fr;
  }

  .day-control {
    display: grid;
  }

  .day-control input {
    width: 100%;
  }

  .user-control,
  .day-control {
    width: 100%;
  }

  .section-header,
  .due-card,
  .market-card .price-line {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .due-card .amount {
    text-align: left;
  }

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

  .npc-portrait,
  .npc-portrait img {
    min-height: 190px;
  }

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

  .room-card,
  .npc-card,
  .npc-card-body,
  .npc-info {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .room-image {
    height: 150px;
  }
}

/* Templo Astral visual system */
:root {
  color-scheme: dark;
  --bg: #060b12;
  --surface: #0f1720;
  --surface-2: #17232d;
  --ink: #f3ead6;
  --muted: #b9b6ac;
  --line: rgba(201, 170, 104, 0.22);
  --line-strong: rgba(226, 199, 138, 0.48);
  --teal: #2db68d;
  --teal-deep: #7de7c9;
  --wine: #8f3a58;
  --brass: #cda96a;
  --violet: #9c86d8;
  --danger: #c35c4e;
  --income: #69d69c;
  --expense: #fb8f78;
  --frost: #d7e7f5;
  --moon: #9bbbd7;
  --sky: #0b1524;
  --emerald: #38c58b;
  --ember: #db8b58;
  --signal-ink: #dec898;
  --signal-line: rgba(126, 101, 58, 0.7);
  --signal-line-soft: rgba(126, 101, 58, 0.34);
  --signal-wash: rgba(88, 64, 29, 0.28);
  --jade-line: rgba(46, 116, 99, 0.68);
  --jade-line-strong: rgba(61, 145, 122, 0.76);
  --amber-line: rgba(143, 98, 45, 0.72);
  --violet-line: rgba(100, 77, 150, 0.74);
  --rare-line: rgba(48, 96, 150, 0.84);
  --shadow: 0 26px 72px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  --shadow-lift: 0 34px 92px rgba(0, 0, 0, 0.56), 0 0 0 1px rgba(205, 169, 106, 0.08);
  --radius: 7px;
  --sidebar: 304px;
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", monospace;
  --ease-ritual: cubic-bezier(.22, .72, .22, 1);
  --motion-fast: 160ms;
  --motion-standard: 260ms;
}

html {
  background: var(--bg);
}

body {
  position: relative;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  word-spacing: 0;
  background: var(--bg) url("assets/backgrounds/atmosphere.png") top center / 100% 100vh no-repeat;
}

::selection {
  color: #130f0b;
  background: var(--brass);
}

button,
input,
textarea,
select {
  font-family: var(--font-body);
}

.sidebar {
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #8b7950 transparent;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -8%, rgba(91, 177, 156, 0.2), transparent 34%),
    linear-gradient(180deg, #101f28 0%, #071219 52%, #040a0f 100%);
  border-right: 1px solid rgba(208, 164, 88, 0.34);
  box-shadow: 18px 0 72px rgba(0, 0, 0, 0.42);
}

.sidebar > .brand,
.sidebar > .nav-list,
.sidebar > .sidebar-toggle,
.sidebar > .side-status { flex-shrink: 0; }
.sidebar > .nav-list { grid-template-columns: minmax(0, 1fr); }

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 22% 13%, rgba(239, 247, 255, 0.82) 0 1px, transparent 1.6px),
    radial-gradient(circle at 73% 26%, rgba(239, 247, 255, 0.42) 0 1px, transparent 1.5px),
    radial-gradient(ellipse at 50% 106%, rgba(25, 77, 70, 0.28), transparent 52%);
  background-size: 173px 173px, 239px 239px, auto;
  opacity: 0.62;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 38%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 108%, rgba(2, 8, 12, 0.98) 0 45%, transparent 74%),
    radial-gradient(ellipse at 6% 114%, rgba(15, 43, 48, 0.72) 0 32%, transparent 65%),
    radial-gradient(ellipse at 96% 115%, rgba(11, 32, 40, 0.8) 0 31%, transparent 64%);
  opacity: 1;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  position: relative;
  padding: 8px 12px 24px;
  border-bottom: 1px solid rgba(208, 164, 88, 0.26);
  border-radius: 0;
  text-align: center;
  background: transparent;
}

.brand::after {
  content: "";
  position: absolute;
  inset: auto 18px -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(61, 145, 122, 0.56), rgba(240, 211, 146, 0.72), transparent);
}

.brand-mark {
  width: 104px;
  height: 104px;
  min-width: 104px;
  padding: 19px;
  border: 1px solid rgba(217, 186, 119, 0.48);
  border-radius: 50%;
  border-color: transparent;
  color: #ffe3a7;
  background:
    radial-gradient(circle, rgba(57, 183, 134, 0.12) 0 41%, transparent 42%),
    repeating-conic-gradient(from 4deg, rgba(230, 201, 134, 0.2) 0 1deg, transparent 1deg 14deg),
    rgba(5, 15, 20, 0.84);
  font-family: var(--font-display);
  font-size: 0.98rem;
  box-shadow: inset 0 0 0 7px rgba(2, 9, 13, 0.78), 0 0 0 4px rgba(205, 169, 106, 0.08), 0 18px 34px rgba(0, 0, 0, 0.44);
  filter: none;
  transition: width var(--motion-standard) var(--ease-ritual), height var(--motion-standard) var(--ease-ritual), min-width var(--motion-standard) var(--ease-ritual), padding var(--motion-standard) var(--ease-ritual), box-shadow var(--motion-standard) ease;
}

.brand-mark img {
  transition: width var(--motion-standard) var(--ease-ritual), height var(--motion-standard) var(--ease-ritual), opacity var(--motion-fast) ease;
}

.brand p,
.topbar h1,
.section-header h2 {
  font-family: var(--font-display);
}

.brand p {
  color: #f8efd8;
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: 0;
  text-shadow: 0 2px 18px rgba(155, 187, 215, 0.12);
}

.brand span {
  color: rgba(243, 234, 216, 0.68);
  font-size: .88rem;
}

.nav-list {
  gap: 2px;
}

.nav-button {
  position: relative;
  min-height: 46px;
  margin-inline: 8px;
  padding-inline: 14px;
  color: rgba(233, 232, 221, 0.76);
  border-color: transparent;
  border-radius: 2px 0 0 2px;
  background: transparent;
  transition: transform 220ms var(--ease-ritual), color var(--motion-fast) ease, border-color 200ms ease, background 220ms ease, padding var(--motion-standard) var(--ease-ritual), gap 220ms var(--ease-ritual);
}

.nav-button::after {
  content: "";
  position: absolute;
  inset: 6px auto 6px -8px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8de7c8, #cda96a);
  box-shadow: 0 0 14px rgba(96, 206, 169, .38);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 220ms var(--ease-ritual), opacity var(--motion-fast) ease;
}

.nav-button span {
  color: rgba(231, 197, 123, 0.84);
}

.nav-button .nav-label {
  color: inherit;
}

.nav-button:hover,
.nav-button.active {
  color: #f9f4e5;
  border-color: rgba(205, 169, 106, 0.28);
  border-right-color: transparent;
  background: linear-gradient(90deg, rgba(42, 112, 95, 0.28), rgba(43, 47, 42, 0.34) 68%, rgba(205, 169, 106, 0.12));
  transform: translateX(10px);
}

.nav-button:hover::after,
.nav-button.active::after {
  transform: scaleY(1);
}

.side-status {
  padding: 16px;
  border-color: rgba(205, 169, 106, 0.32);
  background:
    linear-gradient(145deg, rgba(217, 235, 247, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(12, 21, 28, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 38px rgba(0, 0, 0, 0.24);
}

.side-status span {
  color: rgba(243, 234, 216, 0.58);
}

.side-status strong {
  color: #ffe2a5;
  font-family: var(--font-mono);
}

.workspace {
  position: relative;
  padding: 30px 34px 52px;
}

.topbar {
  position: relative;
  min-height: 86px;
  align-items: start;
  margin-bottom: 28px;
  padding-bottom: 22px;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background:
    linear-gradient(90deg, rgba(240, 211, 146, 0.72), rgba(61, 145, 122, 0.46) 28%, rgba(155, 187, 215, 0.16) 62%, transparent);
  box-shadow: 0 0 34px rgba(56, 197, 139, 0.14);
}

.topbar h1 {
  margin-top: 6px;
  color: #f8efd9;
  font-size: clamp(2.25rem, 4vw, 4.55rem);
  font-weight: 900;
  line-height: 0.98;
  text-shadow: 0 18px 54px rgba(0, 0, 0, 0.55), 0 0 24px rgba(155, 187, 215, 0.12);
}

.profile-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 10px;
}

.profile-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-line strong {
  color: #fff6de;
  font-size: 0.98rem;
  font-weight: 800;
}

.user-control {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.user-control label {
  margin: 0;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(208, 164, 88, 0.34);
  color: #fff1c2;
  background: rgba(208, 164, 88, 0.09);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
}

.role-badge.admin {
  border-color: rgba(208, 164, 88, 0.45);
  background: rgba(208, 164, 88, 0.14);
}

.role-badge.player {
  border-color: var(--jade-line);
  background: rgba(28, 86, 74, 0.22);
  color: #cfece3;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(138, 177, 204, 0.11), transparent 35%),
    rgba(4, 8, 13, 0.9);

}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid rgba(231, 197, 123, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(221, 236, 247, 0.07), rgba(255, 255, 255, 0.015)),
    rgba(10, 18, 25, 0.985);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.auth-brand {
  margin-bottom: 18px;
}

.auth-card h2 {
  margin: 0 0 10px;
  font-size: 1.65rem;
}

.auth-copy,
.auth-note {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-note {
  margin-top: 16px;
  margin-bottom: 0;
}

.eyebrow {
  color: var(--brass);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.075em;
}

.day-control {
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-color: rgba(231, 197, 123, 0.28);
  background:
    linear-gradient(145deg, rgba(218, 237, 248, 0.085), rgba(255, 255, 255, 0.02)),
    rgba(12, 21, 28, 0.88);
  box-shadow: var(--shadow);

}

.day-control label,
label {
  color: rgba(243, 234, 216, 0.8);
}

.day-control.locked {
  opacity: 0.86;
}

.notice,
.toast {
  border-color: rgba(231, 197, 123, 0.52);
  color: #ffe8b6;
  background: rgba(78, 53, 21, 0.86);
  box-shadow: var(--shadow);
}

.toast {
  color: #d2eee7;
  border-color: var(--jade-line-strong);
  background: rgba(11, 53, 50, 0.94);
}

.metric,
.panel,
.room-card,
.npc-card,
.market-card,
.source-card,
.due-card,
.ledger-item,
.empty-state {
  position: relative;
  overflow: hidden;
  border-color: var(--line);
  background:
    linear-gradient(160deg, rgba(219, 237, 249, 0.075), rgba(255, 255, 255, 0.018) 48%, rgba(56, 197, 139, 0.035)),
    rgba(12, 20, 27, 0.88);
  box-shadow: var(--shadow);

}

.metric::before,
.panel::before,
.room-card::before,
.npc-card::before,
.market-card::before,
.source-card::before,
.due-card::before,
.ledger-item::before,
.empty-state::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 231, 245, 0.24), rgba(240, 211, 146, 0.58), transparent);
  opacity: 0.86;
}

.metric {
  min-height: 118px;
  padding: 20px;
}

.metric span {
  color: rgba(215, 225, 231, 0.68);
  font-family: var(--font-display);
  font-size: 0.79rem;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.metric strong {
  color: #f8edd4;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
}

.panel {
  padding: 22px;
}

.view.active > .panel,
.view.active > .dashboard-grid,
.view.active > .metrics {
  animation: temple-arrival 280ms var(--ease-ritual) both;
}

@keyframes temple-arrival {
  from {
    opacity: 0.84;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header h2 {
  color: #f6ebd2;
  font-size: clamp(1.42rem, 2vw, 2rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 18px rgba(231, 197, 123, 0.1);
}

.dashboard-grid {
  gap: 18px;
}

.button {
  position: relative;
  overflow: hidden;
  min-height: 42px;
  border-radius: 6px;
  font-weight: 700;
  word-spacing: 0;
  transition: transform var(--motion-fast) var(--ease-ritual), border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 35%, rgba(255, 255, 255, 0.22) 48%, transparent 62% 100%);
  transform: translateX(-120%);
  transition: transform 360ms var(--ease-ritual);
}

.button:hover {
  transform: translateY(-1px);
}

.button:hover::before {
  transform: translateX(120%);
}

.button.primary {
  color: #04120f;
  border-color: var(--jade-line-strong);
  background: linear-gradient(135deg, #76c8b0, #2d9d78 52%, #1a6b5b);
  box-shadow: 0 15px 40px rgba(18, 83, 66, 0.3);
}

.button.primary:hover {
  background: linear-gradient(135deg, #91dcc5, #39b184 54%, #237c68);
}

.button.subtle {
  color: #f4d89e;
  border-color: rgba(205, 169, 106, 0.42);
  background: linear-gradient(135deg, rgba(205, 169, 106, 0.13), rgba(155, 187, 215, 0.045));
}

.button.ghost {
  color: var(--ink);
  border-color: rgba(215, 231, 245, 0.2);
  background: rgba(217, 235, 247, 0.035);
}

.button.danger {
  color: #fff0e9;
  border-color: rgba(255, 139, 114, 0.34);
  background: linear-gradient(135deg, #973448, #5c1d29);
}

input,
textarea,
select {
  border-color: rgba(205, 169, 106, 0.3);
  color: var(--ink);
  background: rgba(3, 10, 15, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(178, 169, 150, 0.62);
}

select {
  color-scheme: dark;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--jade-line-strong);
  box-shadow: 0 0 0 3px rgba(31, 93, 78, 0.26), 0 0 28px rgba(31, 93, 78, 0.14);
}

button:focus-visible,
.nav-button:focus-visible,
.journey-card-open:focus-visible,
.npc-card-open:focus-visible {
  outline: 2px solid rgba(215, 231, 245, 0.86);
  outline-offset: 3px;
}

.toolbar {
  padding: 10px;
  border: 1px solid rgba(205, 169, 106, 0.18);
  border-radius: var(--radius);
  background: rgba(4, 11, 17, 0.56);

}

.room-grid,
.npc-grid,
.market-grid,
.source-list,
.list-stack,
.compact-stock,
.ledger-preview {
  gap: 14px;
}

.room-card,
.market-card,
.source-card,
.due-card,
.ledger-item,
.empty-state {
  padding: 16px;
}

.room-card,
.market-card,
.source-card,
.due-card,
.ledger-item,
.empty-state,
.npc-card {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.room-card:hover,
.market-card:hover,
.source-card:hover,
.due-card:hover,
.ledger-item:hover,
.npc-card:hover {
  border-color: rgba(231, 197, 123, 0.48);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

/* Long flowing lists can stay dormant until they approach the viewport. */
@supports (content-visibility: auto) {
  .room-card,
  .market-card,
  .source-card,
  .due-card,
  .ledger-item,
  .hero-card,
  .npc-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 360px;
  }
}

/* Touch devices do not benefit from hover lifts, but they pay their paint cost. */
@media (hover: none), (pointer: coarse) {
  .room-card,
  .market-card,
  .source-card,
  .due-card,
  .ledger-item,
  .npc-card,
  .journey-card,
  .market-shelf-item {
    transition: border-color 140ms ease, background-color 140ms ease;
  }

  .room-card:hover,
  .market-card:hover,
  .source-card:hover,
  .due-card:hover,
  .ledger-item:hover,
  .npc-card:hover,
  .market-shelf-item:hover {
    box-shadow: var(--shadow);
    transform: none;
  }
}

.room-card h3,
.source-card h3,
.market-card h3,
.npc-card h3 {
  color: #f8edd5;
  font-family: var(--font-display);
  font-size: 1.03rem;
  font-weight: 400;
}

.room-card p,
.source-card p,
.market-card p,
.npc-card p,
.empty-state p {
  color: rgba(243, 234, 216, 0.68);
}

.muted {
  color: rgba(243, 234, 216, 0.62);
}

.icon-button {
  display: grid;
  place-items: center;
  font-size: 0;
  line-height: 0;
  border-color: rgba(208, 164, 88, 0.28);
  color: #eed39d;
  background: rgba(218, 237, 248, 0.04);
  transition: transform var(--motion-fast) var(--ease-ritual), border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.icon-button::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--icon, var(--icon-edit)) center / contain no-repeat;
  mask: var(--icon, var(--icon-edit)) center / contain no-repeat;
}

.icon-button[data-action^="edit-"] {
  --icon: var(--icon-edit);
}

.icon-button[data-action^="delete-"] {
  --icon: var(--icon-trash);
}

.icon-button[data-action^="close-"],
.icon-button[data-action^="cancel-"],
.icon-button.close-button,
.icon-button[title^="Fechar"],
.icon-button[aria-label^="Fechar"] {
  --icon: var(--icon-close);
}

.icon-button:hover {
  border-color: var(--jade-line-strong);
  color: #c5e8dc;
  background: rgba(31, 93, 78, 0.22);
  transform: translateY(-1px);
}

.chip {
  border-color: rgba(205, 169, 106, 0.28);
  color: #ead2a0;
  background: rgba(205, 169, 106, 0.1);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.chip.income {
  color: #b8ffd8;
  border-color: rgba(112, 214, 163, 0.38);
  background: rgba(112, 214, 163, 0.12);
}

.chip.expense {
  color: #ffc5b7;
  border-color: rgba(255, 139, 114, 0.42);
  background: rgba(255, 139, 114, 0.12);
}

.chip.premium {
  color: #e7c5ff;
  border-color: rgba(159, 121, 185, 0.46);
  background: rgba(159, 121, 185, 0.14);
}

.chip.warn {
  color: #ffe19b;
  border-color: rgba(208, 164, 88, 0.52);
  background: rgba(208, 164, 88, 0.16);
}

.npc-portrait {
  color: #fff0c7;
  background:
    linear-gradient(135deg, rgba(156, 50, 72, 0.94), rgba(15, 118, 109, 0.78)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 12px),
    #261512;
  font-family: var(--font-display);
  box-shadow: inset -1px 0 0 rgba(208, 164, 88, 0.22);
}

.npc-info {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent);
}

.npc-meta,
.source-meta,
.market-meta {
  color: rgba(231, 214, 178, 0.62);
}

.amount.income,
.type-income {
  color: var(--income);
}

.amount.expense,
.type-expense {
  color: var(--expense);
}

table {
  color: var(--ink);
}

th,
td {
  border-bottom-color: rgba(208, 164, 88, 0.18);
}

th {
  color: var(--brass);
  letter-spacing: 0.08em;
}

fieldset {
  border-color: rgba(231, 197, 123, 0.28);
  background: rgba(5, 7, 6, 0.34);
}

legend {
  color: rgba(243, 234, 216, 0.82);
}

.market-card {
  min-height: 226px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}

.market-card .market-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin: 0;
}

.market-card .market-card-icon {
  width: 42px;
  flex-basis: 42px;
  margin: 0;
}

.market-card-identity {
  min-width: 0;
}

.market-card h3 {
  overflow-wrap: anywhere;
}

.market-card-facts,
.market-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.market-card-facts {
  margin-top: 8px;
  color: rgba(243, 234, 216, .62);
  font-size: .78rem;
}

.market-card .market-meta,
.market-card .chip-row.compact {
  display: none;
}

.market-card .market-card-tags {
  min-height: 30px;
  padding: 9px 0 2px;
  border-top: 1px solid rgba(208, 164, 88, .16);
}

.market-card .market-category {
  min-width: 0;
  padding: 4px 0;
  color: rgba(229, 222, 202, .68);
  overflow-wrap: anywhere;
}

.market-card .market-rarity-chip {
  font-weight: 800;
}

.market-card.rarity-uncommon {
  border-color: rgba(226, 150, 77, 0.84);
  background:
    linear-gradient(145deg, rgba(127, 67, 25, 0.22), rgba(10, 20, 27, 0.94) 54%, rgba(226, 150, 77, 0.12)),
    rgba(12, 20, 27, 0.9);
  box-shadow:
    0 28px 84px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 168, 72, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.market-card.rarity-uncommon::after {
  content: "";
  position: absolute;
  inset: auto -18px -18px auto;
  width: 116px;
  height: 116px;
  background: radial-gradient(circle, rgba(255, 168, 72, 0.22), transparent 64%);
  pointer-events: none;
}

.market-card.rarity-rare {
  border-color: var(--rare-line);
  background:
    linear-gradient(160deg, rgba(61, 136, 211, 0.22), rgba(255, 255, 255, 0.016) 42%, rgba(95, 117, 206, 0.16)),
    rgba(12, 20, 27, 0.9);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(48, 96, 150, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.market-card.rarity-rare::after {
  content: "";
  position: absolute;
  inset: auto -12px -12px auto;
  width: 150px;
  height: 150px;
  background:
    radial-gradient(circle, rgba(48, 96, 150, 0.28), transparent 62%),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.11), transparent 36%);
  pointer-events: none;
}

.market-card.rarity-rare h3 {
  color: #cfe3ff;
}

.market-card.rarity-uncommon h3 {
  color: #ffd79b;
}

.market-card .price-line {
  padding-top: 8px;
  border-top: 1px solid rgba(208, 164, 88, 0.18);
}

.market-card .price-line span {
  color: rgba(243, 234, 216, 0.55);
}

.market-card .price-line strong {
  color: #f4e6c9;
  font-family: var(--font-display);
  font-size: 1.34rem;
}

.market-card.rarity-rare .price-line strong {
  color: #d9ebff;
  text-shadow:
    0 0 18px rgba(48, 96, 150, 0.24),
    0 0 34px rgba(48, 96, 150, 0.12);
}

.chip-row.compact {
  justify-content: flex-end;
  margin-top: 0;
}

.market-card.rarity-uncommon .market-rarity-chip {
  color: #5e3306;
  border-color: var(--amber-line);
  background: linear-gradient(180deg, rgba(255, 223, 177, 0.98), rgba(255, 184, 94, 0.88));
}

.market-card.rarity-rare .market-rarity-chip {
  color: #17365d;
  border-color: var(--rare-line);
  background: linear-gradient(180deg, rgba(225, 238, 255, 0.98), rgba(153, 197, 255, 0.9));
}

.market-card.section-permanent {
  border-top: 3px solid rgba(231, 197, 123, 0.38);
}

.market-card.section-consumable {
  border-top: 3px solid var(--jade-line);
}

.user-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.user-card.active {
  border-color: var(--jade-line);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(31, 93, 78, 0.18);
}

.market-card .market-meta .level-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(231, 197, 123, 0.38);
  border-radius: 999px;
  color: #fff2cd;
  background: rgba(231, 197, 123, 0.08);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
}

.market-card .chip.expense {
  color: #ffe9e7;
  border-color: rgba(184, 76, 63, 0.4);
  background: linear-gradient(180deg, rgba(184, 76, 63, 0.96), rgba(130, 33, 35, 0.88));
}

.market-link {
  color: #93cdbd;
  text-decoration-color: rgba(61, 145, 122, 0.44);
}

.empty-state strong {
  color: #fff5dc;
}

.campfire-intro {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  background:
    linear-gradient(118deg, rgba(219, 139, 88, 0.18), transparent 35%),
    linear-gradient(248deg, rgba(56, 197, 139, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(36, 22, 18, 0.98), rgba(11, 18, 23, 0.94));
}

.campfire-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(240, 211, 146, 0.05) 25%, transparent 25%) 0 0 / 19px 19px,
    linear-gradient(315deg, rgba(215, 231, 245, 0.025) 25%, transparent 25%) 0 0 / 19px 19px;
  opacity: 0.28;
}

.campfire-intro > * {
  position: relative;
  z-index: 1;
}

.campfire-editor {
  position: relative;
  margin-bottom: 16px;
}

.campfire-gallery-panel {
  margin-bottom: 16px;
}

#view-campfire {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

#view-campfire > section {
  width: 100%;
  min-width: 0;
}

.campfire-board {
  display: grid;
  gap: 14px;
}

.campfire-board-head {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(231, 197, 123, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(19, 18, 16, 0.88);
}

.campfire-board-head h3 {
  margin: 2px 0 0;
  color: #fff7e1;
  font-family: var(--font-display);
  font-size: 1.28rem;
}

.campfire-goal-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.campfire-lane {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(231, 197, 123, 0.18);
  border-radius: var(--radius);
  background: rgba(16, 18, 16, 0.84);
}

.campfire-lane header {
  display: grid;
  gap: 4px;
}

.campfire-lane h4 {
  margin: 0;
  color: #fff5dc;
  font-family: var(--font-display);
  font-size: 1rem;
}

.lane-short {
  border-top: 3px solid rgba(112, 214, 163, 0.82);
  background:
    linear-gradient(180deg, rgba(112, 214, 163, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(16, 18, 16, 0.84);
}

.lane-medium {
  border-top: 3px solid rgba(255, 168, 72, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 168, 72, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(16, 18, 16, 0.84);
}

.lane-long {
  border-top: 3px solid var(--violet-line);
  background:
    linear-gradient(180deg, rgba(100, 77, 150, 0.13), rgba(255, 255, 255, 0.02)),
    rgba(16, 18, 16, 0.84);
}

.campfire-goal-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.campfire-goal-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(231, 197, 123, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.campfire-goal-item.goal-short {
  border-color: var(--jade-line);
  background:
    linear-gradient(180deg, rgba(46, 116, 99, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.022);
}

.campfire-goal-item.goal-medium {
  border-color: var(--amber-line);
  background:
    linear-gradient(180deg, rgba(143, 98, 45, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.022);
}

.campfire-goal-item.goal-long {
  border-color: var(--violet-line);
  background:
    linear-gradient(180deg, rgba(100, 77, 150, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.022);
}

.campfire-goal-item.secret {
  border-color: rgba(143, 98, 45, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 168, 72, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.018);
}

.campfire-goal-copy {
  display: grid;
  gap: 8px;
}

.campfire-goal-copy p {
  margin: 0;
  color: rgba(243, 234, 216, 0.82);
  line-height: 1.45;
  font-size: 0.92rem;
}

.campfire-secret-chip {
  color: #7d4413;
  border-color: var(--amber-line);
  background: linear-gradient(180deg, rgba(255, 224, 178, 0.98), rgba(255, 192, 110, 0.9));
}

.campfire-gallery {
  display: grid;
  gap: 14px;
}

.hero-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(231, 197, 123, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(122deg, rgba(219, 139, 88, 0.12), transparent 31%),
    linear-gradient(180deg, rgba(14, 22, 27, 0.98), rgba(9, 14, 18, 0.94));
}

.hero-card.active {
  border-color: var(--jade-line);
  box-shadow: 0 26px 84px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(31, 93, 78, 0.18);
}

.hero-card > header {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.hero-avatar {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 197, 123, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 168, 72, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(18, 20, 19, 0.96);
  color: #fff3d2;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-avatar.has-image {
  padding: 0;
  overflow: hidden;
}

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

.hero-headline h3 {
  margin: 0;
  color: #fff6de;
  font-family: var(--font-display);
  font-size: 1.18rem;
}

.hero-goal-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hero-goal-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(231, 197, 123, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.022);
}

.hero-goal-column.goal-short {
  border-color: var(--jade-line);
  background:
    linear-gradient(180deg, rgba(46, 116, 99, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.022);
}

.hero-goal-column.goal-medium {
  border-color: var(--amber-line);
  background:
    linear-gradient(180deg, rgba(143, 98, 45, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.022);
}

.hero-goal-column.goal-long {
  border-color: var(--violet-line);
  background:
    linear-gradient(180deg, rgba(100, 77, 150, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.022);
}

.hero-goal-column-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
}

.hero-goal-column-head strong {
  color: #fff5dc;
  font-size: 0.9rem;
}

.hero-goal-column-head span {
  color: rgba(243, 234, 216, 0.62);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.hero-goal-items {
  display: grid;
  gap: 8px;
}

.hero-goal-chip {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(231, 197, 123, 0.14);
  border-radius: 8px;
  background: rgba(10, 12, 11, 0.42);
}

.hero-goal-chip.goal-short {
  border-color: var(--jade-line);
}

.hero-goal-chip.goal-medium {
  border-color: var(--amber-line);
}

.hero-goal-chip.goal-long {
  border-color: var(--violet-line);
}

.hero-goal-chip span {
  color: rgba(247, 235, 210, 0.88);
  font-size: 0.9rem;
  line-height: 1.35;
}

.hero-goal-chip em {
  color: rgba(255, 197, 113, 0.86);
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-goal-chip.secret {
  border-color: rgba(143, 98, 45, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 168, 72, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(10, 12, 11, 0.52);
}

.hero-goal-empty {
  padding: 10px 12px;
  border: 1px dashed rgba(231, 197, 123, 0.18);
  border-radius: 8px;
  color: rgba(243, 234, 216, 0.54);
  font-size: 0.82rem;
}

.campfire-goal-composer {
  margin-top: 18px;
}

.campfire-notes {
  margin-top: 16px;
  background:
    linear-gradient(135deg, rgba(219, 139, 88, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(22, 29, 31, 0.98), rgba(8, 14, 18, 0.98));
}

.campfire-notes-lead {
  margin: -2px 0 14px;
}

.campfire-notes-read {
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid rgba(208, 164, 88, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(115deg, rgba(208, 164, 88, 0.09), transparent 38%),
    rgba(5, 12, 17, 0.58);
}

.campfire-notes-copy {
  color: rgba(246, 235, 213, 0.9);
  font-size: clamp(1rem, 1vw, 1.08rem);
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.campfire-notes-copy.empty {
  color: rgba(243, 234, 216, 0.58);
  font-style: italic;
}

.campfire-notes textarea {
  min-height: 320px;
  line-height: 1.55;
  resize: vertical;
}

.campfire-investigation {
  overflow: visible;
}

.campfire-investigation .section-header {
  align-items: flex-start;
  gap: 16px;
}

.campfire-investigation .button-row.compact {
  justify-content: flex-end;
}

.campfire-investigation .button.active {
  border-color: rgba(231, 197, 123, 0.72);
  background:
    linear-gradient(135deg, rgba(231, 197, 123, 0.16), rgba(44, 182, 136, 0.08)),
    rgba(11, 18, 21, 0.9);
  color: var(--text);
}

.campfire-investigation.is-fullscreen {
  position: fixed;
  inset: 12px;
  z-index: 950;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  margin: 0;
  padding: clamp(14px, 2vw, 24px);
  background:
    radial-gradient(circle at 18% 12%, rgba(231, 197, 123, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(16, 27, 31, 0.99), rgba(3, 8, 10, 0.99));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.66);
}

.campfire-investigation.is-fullscreen .investigation-board-shell {
  height: auto;
  min-height: 0;
}

.investigation-board-shell {
  position: relative;
  height: min(72vh, 760px);
  min-height: 480px;
  overflow: auto;
  border: 1px solid rgba(179, 145, 78, 0.32);
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 18%, rgba(231, 197, 123, 0.09), transparent 28%),
    radial-gradient(circle at 72% 36%, rgba(52, 173, 139, 0.1), transparent 32%),
    linear-gradient(135deg, rgba(65, 45, 25, 0.18), transparent 35%),
    rgba(4, 10, 13, 0.86);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  scrollbar-color: rgba(231, 197, 123, 0.48) rgba(4, 10, 13, 0.9);
}

.investigation-board {
  position: relative;
  width: 1800px;
  height: 1250px;
  min-width: 100%;
}

.investigation-links,
.investigation-notes {
  position: absolute;
  inset: 0;
}

.investigation-links {
  width: 1800px;
  height: 1250px;
  pointer-events: none;
  overflow: visible;
}

.investigation-link {
  stroke: rgba(219, 174, 93, 0.58);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 7 8;
  /* SVG filters repaint the entire board on every drag frame. */
  filter: none;
}

.investigation-empty {
  position: absolute;
  left: 32px;
  top: 32px;
  max-width: 360px;
  padding: 18px;
  border: 1px dashed rgba(231, 197, 123, 0.28);
  border-radius: 12px;
  color: rgba(246, 235, 213, 0.68);
  background: rgba(5, 11, 14, 0.62);
}

.investigation-note {
  position: absolute;
  width: 220px;
  min-height: 166px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(231, 197, 123, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), transparent 32%),
    rgba(31, 28, 22, 0.94);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.investigation-note.dragging {
  cursor: grabbing;
  transform: rotate(0deg) scale(1.018);
  z-index: 8;
  will-change: left, top, transform;
}

.investigation-note.active,
.investigation-note.connecting {
  border-color: rgba(246, 218, 146, 0.86);
  box-shadow: 0 0 0 2px rgba(231, 197, 123, 0.13), 0 24px 40px rgba(0, 0, 0, 0.36);
  z-index: 6;
}

.investigation-note.note-green {
  border-color: rgba(66, 184, 128, 0.45);
  background: linear-gradient(160deg, rgba(66, 184, 128, 0.11), transparent 35%), rgba(18, 31, 25, 0.95);
}

.investigation-note.note-blue {
  border-color: rgba(104, 154, 201, 0.45);
  background: linear-gradient(160deg, rgba(104, 154, 201, 0.12), transparent 35%), rgba(16, 26, 35, 0.95);
}

.investigation-note.note-violet {
  border-color: rgba(158, 117, 203, 0.48);
  background: linear-gradient(160deg, rgba(158, 117, 203, 0.12), transparent 35%), rgba(28, 21, 36, 0.95);
}

.investigation-note.note-red {
  border-color: rgba(189, 84, 74, 0.5);
  background: linear-gradient(160deg, rgba(189, 84, 74, 0.12), transparent 35%), rgba(37, 20, 18, 0.95);
}

.investigation-note.note-ash {
  border-color: rgba(185, 191, 184, 0.32);
  background: linear-gradient(160deg, rgba(185, 191, 184, 0.08), transparent 35%), rgba(22, 25, 25, 0.96);
}

.investigation-pin {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2bd, #b48337 58%, #2b1a08 100%);
  box-shadow: 0 0 8px rgba(231, 197, 123, 0.42);
}

.investigation-note-image {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: rgba(4, 10, 13, 0.68);
  pointer-events: none;
}

.investigation-note-image img {
  display: block;
  width: 100%;
  max-height: 86px;
  object-fit: contain;
}

.investigation-note-main {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.investigation-note-main strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.investigation-note-main span {
  display: block;
  color: rgba(246, 235, 213, 0.8);
  font-size: 0.86rem;
  line-height: 1.35;
  text-align: justify;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: visible;
}

.investigation-journey-label {
  color: rgba(154, 231, 203, 0.84);
  font-size: 0.74rem;
  font-style: normal;
}

.investigation-note footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(246, 235, 213, 0.58);
  font-size: 0.75rem;
}

.investigation-note footer .icon-button {
  width: 28px;
  height: 28px;
}

.investigation-note-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.investigation-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 44px);
}

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

body.investigation-modal-open {
  overflow: hidden;
}

.investigation-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 5, 7, 0.72);
  backdrop-filter: none;
}

.investigation-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(88vh, 880px);
  overflow: auto;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(231, 197, 123, 0.38);
  border-radius: 16px;
  background:
    radial-gradient(circle at 22% 8%, rgba(231, 197, 123, 0.1), transparent 35%),
    linear-gradient(180deg, rgba(19, 31, 35, 0.98), rgba(5, 10, 13, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.54);
}

.investigation-modal-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.investigation-modal-card h3 {
  margin: 0;
}

.investigation-note-links ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.investigation-note-links li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(231, 197, 123, 0.18);
  border-radius: 8px;
  background: rgba(3, 9, 12, 0.45);
}

.danger-note,
.delete-confirmation-panel {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(201, 82, 72, 0.42);
  border-radius: 10px;
  color: #ffd9d4;
  background: linear-gradient(135deg, rgba(94, 21, 18, 0.35), rgba(15, 8, 8, 0.68));
}

.delete-confirmation-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  line-height: 1.55;
}

.delete-confirmation-panel p {
  margin: 0;
}

@media (max-width: 760px) {
  .campfire-investigation .section-header {
    align-items: stretch;
  }

  .campfire-investigation .button-row.compact {
    justify-content: stretch;
  }

  .campfire-investigation .button-row.compact .button {
    flex: 1 1 auto;
  }

  .investigation-board-shell {
    height: 68vh;
    min-height: 420px;
  }

  .investigation-board,
  .investigation-links {
    width: 1320px;
    height: 980px;
  }

  .investigation-note {
    width: 210px;
  }

  .investigation-modal {
    padding: 12px;
  }

  .investigation-modal-card {
    max-height: 92vh;
  }
}

.journey-intro {
  margin-bottom: 16px;
  background:
    linear-gradient(115deg, rgba(205, 169, 106, 0.15), transparent 35%),
    linear-gradient(240deg, rgba(56, 197, 139, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(29, 25, 21, 0.98), rgba(10, 17, 22, 0.95));
}

.journey-editor {
  margin-bottom: 16px;
}

.journey-board-panel {
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(205, 169, 106, 0.045) 1px, transparent 1px) 0 0 / 29px 29px,
    linear-gradient(180deg, rgba(205, 169, 106, 0.035) 1px, transparent 1px) 0 0 / 29px 29px,
    linear-gradient(135deg, rgba(205, 169, 106, 0.09), transparent 34%),
    rgba(13, 20, 24, 0.95);
}

.journey-toolbar {
  margin-bottom: 16px;
}

.journey-collage {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  padding: 14px 7px 0;
}

.journey-column {
  flex: 1 1 0;
  min-width: 0;
}

.journey-collage > * {
  min-width: 0;
  max-width: 100%;
}

.journey-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 10px 0 18px;
  break-inside: avoid;
  border: 1px solid rgba(231, 197, 123, 0.32);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 244, 215, 0.1), rgba(255, 255, 255, 0.026)),
    rgba(28, 24, 20, 0.95);
  box-shadow: 0 5px 12px #0005;
  transform: rotate(-0.35deg);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.journey-card.has-unread {
  border-color: var(--pin-color);
}

.journey-card:nth-child(3n) {
  transform: rotate(0.45deg);
}

.journey-card:nth-child(4n) {
  transform: rotate(-0.7deg);
}

.journey-card::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 13px;
  height: 13px;
  transform: translateX(-50%) rotate(-2deg);
  border: 1px solid rgba(231, 197, 123, 0.18);
  border-radius: 50%;
  background: var(--pin-color);
  box-shadow: inset 0 1px 2px #fff9, inset 0 -2px 2px #0006, 0 2px 3px #0009;
  z-index: 2;
  pointer-events: none;
}

.journey-card-open {
  position: relative;
  width: 100%;
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.journey-card-open img,
.journey-detail-image {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.22);
}

.journey-image-placeholder {
  min-height: 170px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(231, 197, 123, 0.28);
  border-radius: 6px;
  color: rgba(246, 230, 201, 0.58);
  font-family: var(--font-display);
}

.journey-card-title {
  color: #fff5dc;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.journey-level {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(231, 197, 123, 0.32);
  border-radius: 999px;
  color: #ffe9aa;
  background: rgba(231, 197, 123, 0.1);
  font-size: 0.75rem;
  font-weight: 800;
}

.journey-unread-badge {
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--signal-line);
  border-radius: 999px;
  color: var(--signal-ink);
  background: var(--signal-wash);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.journey-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display:flex;
  gap:5px;
  opacity:0;
  transition:opacity 150ms ease;
}

#view-journey .journey-intro,
#view-journey .journey-board-panel { background:none; border:0; box-shadow:none; padding:0; }
.journey-toolbar { display:flex; flex-wrap:wrap; gap:12px; }
#journeySearch { flex:1; min-width:180px; }
.journey-sort-controls, .journey-category-chips { display:flex; flex-wrap:wrap; gap:8px; }
.journey-category-chips { margin:12px 0 26px; }
.journey-filter, .journey-sort-controls button { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); background:#0e191e; color:var(--muted); padding:9px 13px; border-radius:24px; cursor:pointer; font:inherit; font-size:.82rem; }
.journey-filter[aria-pressed="true"], .journey-sort-controls button[aria-pressed="true"] { color:#edd18b; border-color:#b99b53; background:#b99b531c; }
.journey-card, .journey-filter { --pin-color:#62c7a2; --category-icon:var(--icon-campfire); }
.category-location { --pin-color:#dfbe6e; --category-icon:var(--icon-map); }
.category-creature { --pin-color:#e18f77; --category-icon:var(--icon-npc); }
.category-character { --pin-color:#83b4cc; --category-icon:var(--icon-npc); }
.category-faction { --pin-color:#b79bc8; --category-icon:var(--icon-home); }
.category-relic { --pin-color:#d3af83; --category-icon:var(--icon-trophies); }
.category-all { --pin-color:#dfbe6e; --category-icon:var(--icon-journey); }
.journey-category-icon { display:inline-block; width:14px; height:14px; flex:none; background:var(--pin-color); mask:var(--category-icon) center/contain no-repeat; }
#journeyGallery .journey-card:hover,
#journeyGallery .journey-card:focus-within { transform:translateY(-3px) rotate(0); box-shadow:0 9px 18px #0006; z-index:3; }
.journey-card:hover .journey-card-actions,
.journey-card:focus-within .journey-card-actions { opacity:1; }
.journey-card-actions .icon-button { background:#0a141de8; }
#journeyGallery .journey-card-open { display:block; content-visibility:auto; overflow:hidden; border-radius:5px; aspect-ratio:var(--photo-ratio, .8); min-height:0; }
#journeyGallery .journey-card-open img, #journeyGallery .journey-image-placeholder { position:absolute; inset:0; width:100%; height:100%; aspect-ratio:auto; object-fit:contain; min-height:0; max-height:none; background:#0c171b; }
#journeyGallery .journey-photo-caption { position:absolute; inset:auto 0 0; margin-top:0; padding:48px 14px 14px; background:linear-gradient(transparent,#091217e8 45%,#091217); display:grid; gap:9px; pointer-events:none; }
.journey-photo-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
#journeyGallery .journey-category { display:inline-flex; align-items:center; gap:5px; color:var(--pin-color); font-size:.72rem; }
.journey-comment-count { position:absolute; top:10px; left:10px; display:flex; align-items:center; gap:5px; padding:4px 7px; border-radius:12px; background:#071015df; color:#f5eedb; font-size:.72rem; }
.journey-comment-count i { width:11px; height:9px; border:1px solid currentColor; border-radius:4px; }
.journey-comment-count i::after { content:""; display:block; width:3px; height:3px; margin:7px 0 0 1px; border-left:1px solid currentColor; transform:skewY(-30deg); }
.journey-comment-count b { color:var(--pin-color); }
@media(hover:none) { .journey-card-actions { opacity:1; } }

@media(prefers-reduced-motion:reduce) { #journeyGallery .journey-card { transition:none; transform:none; } }

.journey-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.journey-modal[hidden] {
  display: none;
}

body.journey-modal-open {
  overflow: hidden;
}

.journey-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 5, 5, 0.72);
  cursor: pointer;
}

.journey-modal-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  border: 1px solid rgba(231, 197, 123, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(130deg, rgba(205, 169, 106, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(15, 23, 29, 0.99), rgba(6, 12, 17, 0.99));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.66);
  animation: temple-dialog 220ms ease both;
}

.journey-modal .journey-detail {
  position: static;
  min-width: 0;
}

.journey-detail-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

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

.journey-detail-card h3 {
  margin: 0;
  color: #fff6de;
  font-family: var(--font-display);
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.journey-description {
  margin: 0;
  color: rgba(243, 234, 216, 0.78);
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.journey-comments {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(231, 197, 123, 0.16);
}

.journey-comment-form,
.journey-comment-edit-form {
  display: grid;
  gap: 10px;
}

.journey-comment-form textarea,
.journey-comment-edit-form textarea {
  min-height: 84px;
  resize: vertical;
}

.journey-comment-list {
  display: grid;
  gap: 10px;
}

.journey-comment {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(231, 197, 123, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.journey-comment strong {
  color: #fff5dc;
}

.journey-comment span {
  display: block;
  margin-top: 2px;
  color: rgba(246, 230, 201, 0.52);
  font-size: 0.82rem;
}

.journey-comment p {
  margin: 0;
  color: rgba(243, 234, 216, 0.76);
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.journey-comment .comment-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.journey-comment.editing {
  padding-right: 12px;
}

.journey-comment-edit-form label {
  display: grid;
  gap: 6px;
  color: rgba(246, 230, 201, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.campfire-goal-empty,
.hero-goal-empty {
  word-break: break-word;
}

.campfire-intro .chip-row {
  justify-content: flex-end;
}

/* Performance: entry animations removed to keep large pages responsive. */

@media (max-width: 860px) {
  .workspace {
    padding: 22px 18px 44px;
  }

  .topbar h1 {
    font-size: 2.75rem;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(208, 164, 88, 0.34);
  }

  .nav-button:hover,
  .nav-button.active {
    transform: translateY(-1px);
  }

  .campfire-layout,
  .hero-card > header,
  .hero-goal-columns,
  .campfire-goal-columns {
    grid-template-columns: 1fr;
  }

  .journey-modal {
    padding: 14px;
  }

  .journey-collage {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }

  .hero-card > header {
    align-items: start;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .topbar h1 {
    font-size: 2.35rem;
  }

  .day-control {
    align-items: stretch;
  }

  .metric {
    min-height: 106px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

.date-fields {
  display: grid;
  grid-template-columns: 78px minmax(128px, 1fr);
  gap: 8px;
  width: 100%;
}

.calendar-date-control {
  min-width: min(420px, 100%);
}

.calendar-date-control label {
  min-width: 250px;
}

.day-control input {
  width: 100%;
}

.inline-form {
  grid-template-columns: minmax(180px, 1fr) 140px 130px minmax(220px, 0.8fr) auto;
}

.inline-date {
  align-self: stretch;
}

.image-preview {
  min-height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(208, 164, 88, 0.34);
  border-radius: var(--radius);
  color: rgba(243, 234, 216, 0.56);
  background:
    linear-gradient(135deg, rgba(205, 169, 106, 0.1), transparent),
    rgba(4, 11, 17, 0.5);
}

.image-preview img {
  width: 100%;
  height: 168px;
  object-fit: cover;
}

.room-image {
  width: 100%;
  height: 164px;
  margin: 0 0 12px;
  border: 1px solid rgba(208, 164, 88, 0.22);
  border-radius: calc(var(--radius) - 1px);
  object-fit: cover;
  filter: saturate(0.98) contrast(1.05);
}

.calendar-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.calendar-controls {
  margin-bottom: 16px;
}

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

.auto-process {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(208, 164, 88, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

.calendar-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.38fr);
  gap: 16px;
  align-items: start;
}

.calendar-months {
  min-width: 0;
}

.calendar-board,
.calendar-selected-day {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(218, 237, 248, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(11, 20, 27, 0.9);
  box-shadow: var(--shadow);
}

.calendar-board::before,
.calendar-selected-day::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 231, 245, 0.24), rgba(240, 211, 146, 0.5), transparent);
}

.calendar-board-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(208, 164, 88, 0.16);
}

.calendar-board-head h3 {
  margin: 0;
  color: #fff5dc;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
}

.calendar-month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  overflow: visible;
  border-bottom: 1px solid rgba(208, 164, 88, 0.12);
}

.calendar-month-tabs button {
  min-width: max-content;
  padding: 8px 11px;
  border: 1px solid rgba(208, 164, 88, 0.2);
  border-radius: 999px;
  color: rgba(243, 234, 216, 0.72);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.calendar-month-tabs button.active {
  color: #071410;
  border-color: var(--jade-line-strong);
  background: linear-gradient(135deg, #75c6af, #c39b5e);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1px;
  padding: 16px;
  overflow: hidden;
}

.calendar-day-cell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(38px, 1fr);
  gap: 8px;
  min-height: clamp(90px, 8.2vw, 112px);
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(208, 164, 88, 0.18);
  border-radius: 5px;
  color: inherit;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(215, 231, 245, 0.04), transparent 36%),
    rgba(5, 12, 18, 0.7);
  cursor: pointer;
}

.calendar-day-cell:hover,
.calendar-day-cell.selected {
  border-color: var(--jade-line-strong);
  background: rgba(23, 61, 56, 0.46);
}

.calendar-day-cell.today {
  box-shadow: inset 0 0 0 1px var(--signal-line), 0 0 24px rgba(91, 67, 31, 0.1);
}

.calendar-day-number {
  color: #fff7e1;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 400;
}

.calendar-day-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 12px;
}

.calendar-day-dots em {
  color: rgba(243, 234, 216, 0.55);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-style: normal;
}

.calendar-day-preview {
  display: grid;
  gap: 4px;
  align-content: start;
}

.calendar-day-preview small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: rgba(243, 234, 216, 0.72);
  font-size: 0.68rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-preview small.income {
  color: var(--income);
}

.calendar-day-preview small.expense {
  color: var(--expense);
}

.calendar-day-panel {
  min-width: 0;
}

.calendar-selected-day {
  padding: 16px;
}

.calendar-entry-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.calendar-selected-day .calendar-entry-list {
  padding: 0;
}

.calendar-entry-list.detailed {
  margin-top: 12px;
}

.calendar-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(208, 164, 88, 0.18);
  border-radius: var(--radius);
  background: rgba(4, 11, 17, 0.45);
}

.calendar-entry.pending {
  border-color: rgba(208, 164, 88, 0.48);
  background: rgba(94, 62, 14, 0.18);
}

.calendar-entry.income {
  box-shadow: inset 3px 0 0 rgba(112, 214, 163, 0.72);
}

.calendar-entry.expense {
  box-shadow: inset 3px 0 0 rgba(255, 139, 114, 0.72);
}

.calendar-entry h4 {
  margin: 3px 0 0;
  color: #fff7e2;
  font-size: 1rem;
}

.calendar-entry p {
  margin: 6px 0 0;
  color: rgba(243, 234, 216, 0.64);
}

.calendar-date {
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .calendar-layout,
  .calendar-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .inline-form {
    grid-template-columns: 1fr;
  }

  .calendar-date-control label {
    min-width: 0;
  }

  .calendar-mini {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

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

@media (max-width: 1280px) {
  .calendar-mini {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .calendar-mini {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .calendar-mini {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .date-fields {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .journey-collage {
    grid-template-columns: 1fr;
  }

  .auto-process {
    white-space: normal;
  }

  .calendar-entry {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px;
  }

  .calendar-day-cell {
    min-height: 92px;
    padding: 8px;
  }

  .campfire-intro .chip-row {
    justify-content: flex-start;
  }

  .hero-card > header {
    grid-template-columns: 1fr;
  }

  .hero-avatar {
    width: 58px;
    height: 58px;
  }
}


/* Direct performance and layout cleanup */
.brand-mark img {
  width: 66px;
  height: 66px;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.sidebar-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(208, 164, 88, 0.3);
  border-radius: var(--radius);
  color: #eed49e;
  background: rgba(215, 231, 245, 0.045);
  transition: transform var(--motion-fast) var(--ease-ritual), color var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.sidebar-toggle:hover {
  transform: translateX(-1px);
  border-color: rgba(225, 195, 128, .58);
  background: rgba(36, 99, 84, .19);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.sidebar-toggle span {
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateX(2px) rotate(-45deg);
  transition: transform 220ms var(--ease-ritual);
}

.mobile-nav-toggle,
.sidebar-scrim {
  display: none;
}

body.sidebar-collapsed {
  --sidebar: 88px;
}

body.sidebar-collapsed .sidebar {
  align-items: center;
  padding-inline: 14px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .brand-mark {
  width: 58px;
  height: 58px;
  min-width: 58px;
  padding: 9px;
}

body.sidebar-collapsed .brand-mark img {
  width: 40px;
  height: 40px;
}

body.sidebar-collapsed .brand > div:not(.brand-mark) {
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
}

body.sidebar-collapsed .nav-list {
  width: 100%;
}

body.sidebar-collapsed .nav-button {
  justify-content: center;
  padding-inline: 10px;
  gap: 0;
}

body.sidebar-collapsed .nav-button:hover,
body.sidebar-collapsed .nav-button.active {
  transform: translateX(0);
}

body.sidebar-collapsed .nav-button > span[aria-hidden="true"] {
  margin: 0;
}

body.sidebar-collapsed .nav-label {
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
}

body.sidebar-collapsed .side-status {
  max-height: 0;
  margin: 0;
  padding-block: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  border-color: transparent;
}

body.sidebar-collapsed .sidebar-toggle span {
  transform: translateX(-2px) rotate(135deg);
}

#dayForm .date-fields {
  grid-template-columns: 78px minmax(128px, 1fr) 88px;
}

.logout-button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: .78rem;
}

.dashboard-hero-card {
  display: grid;
  grid-template-columns: clamp(184px, 22vw, 250px) minmax(0, 1fr);
  min-height: 0;
  align-items: start;
  padding: 0;
  overflow: visible;
  margin-bottom: 16px;
  background:
    radial-gradient(circle at 76% 12%, rgba(205, 169, 106, 0.12), transparent 34%),
    linear-gradient(118deg, rgba(56, 197, 139, 0.11), transparent 48%),
    rgba(12, 20, 27, 0.9);
}

.dashboard-hero-card > .empty-state {
  grid-column: 1 / -1;
  padding: 28px;
}

.dashboard-hero-card.is-empty {
  min-height: 0;
  display: block;
}

.dashboard-hero-portrait {
  position: relative;
  width: 100%;
  min-height: 0;
  align-self: start;
  justify-self: start;
  display: block;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(229, 199, 131, .48);
  color: #f7e6b8;
  background:
    linear-gradient(180deg, rgba(205, 169, 106, .12), transparent 24%),
    radial-gradient(circle at 50% 32%, rgba(56, 197, 139, .18), transparent 45%),
    #071117;
  box-shadow:
    inset 0 0 0 5px rgba(4, 12, 16, .78),
    inset 0 0 0 6px rgba(95, 151, 132, .28);
  font-family: var(--font-display);
  font-size: 3.4rem;
}

.dashboard-hero-portrait:not(.has-image) {
  min-height: 360px;
  display: grid;
  place-items: center;
}

.dashboard-hero-portrait::after {
  content: none;
}

.dashboard-hero-portrait img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
  object-position: left top;
  border: 1px solid rgba(229, 199, 131, .34);
  background: #071117;
}

.dashboard-hero-sheet {
  min-width: 0;
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 16px;
  padding: 28px;
}

.dashboard-hero-goals {
  grid-column: 1 / -1;
  width: 100%;
  padding: 20px 28px 28px;
}

.dashboard-hero-identity {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(205, 169, 106, .24);
}

.dashboard-hero-identity-copy { flex: 1 1 170px; min-width: 0; overflow-wrap: anywhere; }

.dashboard-hero-identity h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 3.25rem);
  font-weight: 500;
  line-height: 1;
}

.hero-identity-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  margin: 9px 0 0;
  color: #e7d3a7;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero-identity-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hero-identity-meta i {
  color: rgba(205, 169, 106, .68);
  font-style: normal;
}

.dashboard-orbit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.dashboard-side-stack {
  display: grid;
  gap: 18px;
}

.dashboard-faith-card {
  margin: 0 0 16px;
  background:
    radial-gradient(circle at 10% 10%, rgba(231, 197, 123, 0.12), transparent 32%),
    linear-gradient(130deg, rgba(56, 197, 139, 0.08), rgba(7, 15, 21, 0.94) 42%, rgba(42, 29, 57, 0.2)),
    rgba(10, 17, 24, 0.92);
}

.faith-compact {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.faith-compact span {
  color: #f5e5bd;
  font-family: var(--font-display);
  font-size: clamp(1.42rem, 2vw, 2rem);
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1;
  text-transform: none;
  text-shadow: 0 0 18px rgba(231, 197, 123, 0.14);
}

.faith-compact strong,
.faith-counter strong {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 225, 135, 0.5);
  border-radius: 999px;
  color: #f9f0d5;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 238, 172, 0.22), rgba(30, 93, 77, 0.14) 52%, rgba(5, 11, 15, 0.82) 74%),
    rgba(8, 14, 18, 0.74);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  font-size: clamp(1.42rem, 2vw, 2rem);
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1;
  box-shadow:
    0 0 0 4px rgba(255, 225, 135, 0.045),
    0 0 24px rgba(255, 220, 126, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  text-shadow:
    0 0 10px rgba(255, 229, 154, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.65);
}

.faith-compact em {
  min-width: 92px;
  padding: 7px 11px;
  border: 1px solid rgba(231, 197, 123, 0.3);
  border-radius: 999px;
  color: var(--text-muted);
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.faith-use-button {
  position: relative;
  isolation: isolate;
  min-height: 48px;
  border-color: rgba(231, 197, 123, 0.55);
  color: #07110f;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 245, 199, 0.92), transparent 22%),
    linear-gradient(135deg, #f4dc8e 0%, #69d9ad 42%, #1f9c79 100%);
  box-shadow:
    0 0 0 1px rgba(246, 223, 142, 0.22),
    0 10px 28px rgba(38, 194, 145, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: none;
  overflow: hidden;
}

.faith-use-button::after {
  content: "";
  position: absolute;
  inset: -45% -20%;
  z-index: -1;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.42) 50%, transparent 62%);
  transform: translateX(-70%);
  transition: transform 480ms ease;
}

.faith-use-button:hover:not(:disabled),
.faith-use-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(246, 223, 142, 0.42),
    0 0 26px rgba(231, 197, 123, 0.18),
    0 16px 34px rgba(38, 194, 145, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.faith-use-button:hover:not(:disabled)::after,
.faith-use-button:focus-visible:not(:disabled)::after {
  transform: translateX(70%);
}

.dashboard-faith-card.collapsed {
  padding-block: 14px;
}

.dashboard-faith-card.collapsed .faith-summary,
.dashboard-faith-card.collapsed .faith-confirm,
.dashboard-faith-card.collapsed .faith-rule-card {
  display: none;
}

.dashboard-faith-card:not(.collapsed) .faith-compact {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(231, 197, 123, 0.18);
}

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

.faith-traits,
.faith-rule-card header > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faith-trait,
.faith-rule-card header span,
.faith-rule-card header strong,
.faith-chip {
  color: #f7e6b8;
}

.faith-trait,
.faith-rule-card header > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(231, 197, 123, 0.34);
  border-radius: 999px;
  background: rgba(231, 197, 123, 0.08);
  font-size: .78rem;
  font-weight: 900;
}

.faith-counter {
  min-width: 170px;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.faith-counter span {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

.faith-counter strong {
  display: block;
}

.faith-confirm {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(231, 197, 123, 0.28);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 8% 20%, rgba(231, 197, 123, 0.12), transparent 35%),
    rgba(7, 12, 17, 0.66);
}

.faith-confirm p {
  color: var(--text-muted);
  text-align: left;
}

.button-row.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.faith-rule-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(231, 197, 123, 0.2);
  border-radius: var(--radius);
  background: rgba(4, 11, 15, 0.42);
}

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

.faith-rule-card p,
.faith-rule-card li {
  color: var(--text-muted);
  text-align: justify;
}

.faith-rule-card h3 {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: .9rem;
  text-transform: uppercase;
}

.faith-rule-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.faith-outcomes > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.faith-outcome {
  padding: 10px 12px;
  border: 1px solid rgba(231, 197, 123, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.faith-outcome.critical-success {
  border-color: rgba(255, 214, 87, 0.72);
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 237, 151, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(135, 92, 24, 0.46), rgba(45, 31, 9, 0.72)),
    rgba(12, 10, 5, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 214, 87, 0.1),
    0 0 26px rgba(255, 199, 62, 0.18),
    inset 0 1px 0 rgba(255, 248, 202, 0.16);
}

.faith-outcome.critical-success strong {
  color: #ffe083;
  text-shadow: 0 0 14px rgba(255, 206, 77, 0.36);
}

.faith-outcome.success {
  border-color: rgba(74, 205, 136, 0.54);
  background:
    radial-gradient(circle at 12% 14%, rgba(122, 232, 168, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(28, 106, 68, 0.36), rgba(7, 34, 24, 0.7)),
    rgba(6, 13, 10, 0.7);
  box-shadow:
    0 0 0 1px rgba(74, 205, 136, 0.08),
    0 0 20px rgba(74, 205, 136, 0.11),
    inset 0 1px 0 rgba(196, 255, 216, 0.1);
}

.faith-outcome.success strong {
  color: #a9f1c2;
  text-shadow: 0 0 12px rgba(75, 210, 138, 0.22);
}

.faith-outcome.failure {
  border-color: rgba(213, 78, 75, 0.54);
  background:
    radial-gradient(circle at 12% 14%, rgba(239, 118, 98, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(111, 31, 30, 0.36), rgba(39, 10, 12, 0.72)),
    rgba(15, 6, 7, 0.72);
  box-shadow:
    0 0 0 1px rgba(213, 78, 75, 0.08),
    0 0 18px rgba(213, 78, 75, 0.1),
    inset 0 1px 0 rgba(255, 196, 180, 0.08);
}

.faith-outcome.failure strong {
  color: #ffb3a6;
  text-shadow: 0 0 12px rgba(213, 78, 75, 0.2);
}

.faith-outcome.critical-failure {
  border-color: rgba(4, 5, 7, 0.9);
  background:
    radial-gradient(circle at 12% 14%, rgba(107, 112, 126, 0.14), transparent 32%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.86), rgba(15, 17, 23, 0.78)),
    rgba(2, 3, 5, 0.9);
  box-shadow:
    0 0 0 1px rgba(231, 197, 123, 0.07),
    0 0 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.faith-outcome.critical-failure strong {
  color: #d8d9df;
  text-shadow: 0 0 12px rgba(180, 185, 205, 0.16);
}

.faith-outcome p {
  margin-top: 4px;
}

.dashboard-hero-content {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dash-hero-avatar {
  width: 112px;
  height: 112px;
  min-height: 0;
  align-self: start;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(231, 197, 123, 0.38);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(40, 34, 24, .88), rgba(7, 15, 21, .97));
  color: #fff3d2;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.dash-hero-avatar img,
.image-preview img,
.npc-portrait img,
.hero-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.room-card {
  height: auto;
  min-height: 0;
  overflow: visible;
}

#roomList{grid-template-columns:repeat(auto-fill,minmax(min(480px,100%),1fr));align-items:stretch;gap:18px}
#roomList .room-card{--room-status:#8c9da6;position:relative;display:grid;grid-template-columns:120px minmax(0,1fr);align-content:start;gap:16px;min-width:0;padding:18px;border:1px solid #2d3b42;border-radius:8px;background:#121d23;box-shadow:0 4px 12px rgba(0,0,0,.18)}
#roomList .room-card::before{display:none}
#roomList .room-status-active{--room-status:#4ed0a0}#roomList .room-status-building{--room-status:#d4ae5b}#roomList .room-status-blocked{--room-status:#d47c67}
.room-thumbnail{position:relative;width:120px;height:140px;border-radius:6px;overflow:hidden;background:linear-gradient(140deg,#192e34,#122323);display:grid;place-items:center}
.room-thumbnail img{width:100%;height:100%;object-fit:contain}.room-thumbnail-placeholder{width:44px;height:44px;background:var(--brass);mask:var(--icon-room) center/contain no-repeat}
.room-status-seal{position:absolute;bottom:7px;left:7px;right:7px;display:flex;align-items:center;gap:5px;width:fit-content;max-width:calc(100% - 14px);padding:4px 6px;border:1px solid color-mix(in srgb,var(--room-status) 55%,transparent);border-radius:999px;background:rgba(9,20,22,.88);color:var(--room-status);font:600 .64rem/1.3 var(--font-body);overflow-wrap:anywhere}.room-status-seal i{width:5px;height:5px;background:currentColor;border-radius:50%;flex-shrink:0}
.room-card-content{min-width:0;display:flex;flex-direction:column;gap:10px}.room-card-content>header{margin:0;min-height:62px;gap:10px;flex-wrap:wrap}.room-heading{min-width:0;flex:1 1 130px}.room-heading h3{margin:0 0 7px;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.room-type{display:inline-block;max-width:100%;font-size:.67rem;color:var(--brass);border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.room-upgrade-action{align-self:flex-start;flex-shrink:0;min-height:36px}.room-overview{margin:0;min-width:0}.room-overview summary{cursor:pointer;list-style:none}.room-overview summary::-webkit-details-marker{display:none}.room-description-preview{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:40px;font-size:.8rem;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}.room-read-more,.room-read-less{font-size:.72rem;color:var(--brass);display:block;margin-top:5px}.room-read-less{display:none}.room-overview[open] .room-read-more,.room-overview[open] .room-description-preview{display:none}.room-overview[open] .room-read-less{display:block}.room-expanded-copy{font-size:.82rem;line-height:1.55;overflow-wrap:anywhere}.room-expanded-copy p{margin:8px 0}
.room-stat-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:4px 0 0;padding:12px 0 0;border-top:1px solid var(--line);margin-top:auto}.room-stat{min-width:0}.room-stat dt{display:flex;align-items:center;gap:5px;font-size:.62rem;color:var(--muted);text-transform:uppercase}.room-stat dt i{display:block;width:16px;height:16px;background:var(--brass);mask:var(--icon-peak) center/contain no-repeat;flex-shrink:0}.room-stat.stat-usage dt i{mask-image:var(--icon-npc);background:var(--moon)}.room-stat.stat-upgrade dt i{mask-image:var(--icon-finance);background:var(--emerald)}.room-stat dd{margin:6px 0 0;color:var(--ink);font-size:.73rem;line-height:1.45;height:4.35em;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.room-maintenance-actions{position:absolute;top:8px;left:24px;display:flex;gap:5px;z-index:2;opacity:0;pointer-events:none;transition:opacity .16s}.room-maintenance-actions .icon-button{position:static;background:rgba(9,17,20,.92);width:30px;height:30px} .room-card:hover .room-maintenance-actions,.room-card:focus-within .room-maintenance-actions{opacity:1;pointer-events:auto}
@media(hover:none){.room-maintenance-actions{opacity:1;pointer-events:auto}}
@media(max-width:480px){#roomList .room-card{grid-template-columns:88px minmax(0,1fr);padding:14px;gap:12px}.room-thumbnail{width:88px;height:112px}.room-card-content{display:contents}.room-card-content>header{grid-column:2;min-width:0}.room-overview,.room-stat-strip{grid-column:1/-1}.room-maintenance-actions{left:17px}.room-stat-strip{gap:8px}.room-heading{flex-basis:100%}}

.room-image {
  width: 100%;
  height: 164px;
  max-height: 220px;
  display: block;
  object-fit: cover;
}

.dash-goal-grid,
.next-cycle-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dash-goal {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(231, 197, 123, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.022);
}

.dash-goal.goal-short { border-color: var(--jade-line); }
.dash-goal.goal-medium { border-color: var(--amber-line); }
.dash-goal.goal-long { border-color: var(--violet-line); }
.dash-goal p { margin: 8px 0 0; color: rgba(247, 235, 210, 0.84); }
.dash-goal ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.dash-goal li {
  padding: 8px 9px;
  border: 1px solid rgba(231, 197, 123, 0.12);
  border-radius: 6px;
  color: rgba(247, 235, 210, 0.86);
  background: rgba(0, 0, 0, 0.16);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dash-goal em { margin-left: 6px; color: #ffd28a; font-style: normal; font-size: .72rem; text-transform: uppercase; }

.dashboard-journey-panel {
  margin-bottom: 16px;
}

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

.dashboard-journey-comments {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(231, 197, 123, 0.16);
}

.dashboard-journey-comments .section-header {
  margin-bottom: 0;
}

.dashboard-journey-comments h3 {
  margin: 0;
  font-size: clamp(1.08rem, 1.4vw, 1.32rem);
}

.dashboard-journey-card {
  display: grid;
  grid-template-columns: 54px minmax(88px, 128px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(231, 197, 123, 0.22);
  border-radius: var(--radius);
  color: inherit;
  text-align: left;
  background: linear-gradient(100deg, rgba(205, 169, 106, .08), transparent 44%), rgba(10, 17, 22, .9);
  cursor: pointer;
}

.dashboard-journey-card:hover {
  border-color: var(--signal-line);
  transform: translateY(-1px);
}

.dashboard-journey-card.has-unread {
  border-color: rgba(116, 151, 184, 0.82);
  box-shadow:
    0 0 0 1px rgba(158, 190, 222, 0.34),
    0 14px 30px rgba(0, 0, 0, 0.2),
    0 0 24px rgba(85, 129, 170, 0.24);
}

.dashboard-journey-card .journey-unread-badge {
  grid-column: 3;
  justify-self: start;
}

.dashboard-journey-card time {
  display: grid;
  place-items: center;
  padding-right: 12px;
  border-right: 1px solid rgba(205, 169, 106, .28);
  color: #d9bd80;
  font-family: var(--font-display);
  font-size: 1.04rem;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.dashboard-journey-memory {
  display: grid;
  place-items: center;
  min-width: 0;
  background: rgba(0, 0, 0, .22);
}

.dashboard-journey-card img,
.dashboard-journey-card .journey-image-placeholder {
  width: 100%;
  height: 108px;
  display: grid;
  place-items: center;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.dashboard-journey-copy {
  min-width: 0;
  align-self: center;
}

.dashboard-journey-copy p {
  display: -webkit-box;
  margin: 9px 0 0;
  overflow: hidden;
  color: rgba(243, 234, 216, .68);
  line-height: 1.35;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.dashboard-journey-card strong,
.dashboard-journey-card small {
  display: block;
  overflow-wrap: anywhere;
}

.dashboard-journey-card strong {
  color: #fff5dc;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.12;
}

.dashboard-journey-card small {
  margin-top: 4px;
  color: #ffe9aa;
  font-weight: 800;
}

.market-overview-card strong {
  display: block;
  margin-top: 6px;
  color: #fff6dd;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

#recentLedger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#recentLedger .ledger-item { min-width: 0; padding: 12px; }
#dashboardCalendarGrid { grid-template-columns:repeat(18,minmax(0,1fr)); gap:5px; max-height:none; overflow:visible; }
#view-dashboard .dashboard-orbit { grid-template-columns:minmax(0,1fr); }
#dashboardCalendarGrid .dashboard-calendar-day { min-height:0; height:44px; padding:4px; border-radius:3px; box-shadow:none; background:#ffffff04; }
#dashboardCalendarGrid .dashboard-calendar-day header { display:block; }
#dashboardCalendarGrid .dashboard-calendar-day header strong { font-size:.68rem; }
#dashboardCalendarGrid .dashboard-calendar-day header > span { display:none; }
#dashboardCalendarGrid .dashboard-calendar-day.has-entries { background:#66c9ad22; opacity:1; }
#dashboardCalendarGrid .dashboard-calendar-day.today { border:2px solid #61cda9; background:#61cda912; }
#dashboardCalendarGrid .calendar-mini-dots { min-height:0; gap:2px; }
#dashboardCalendarGrid .calendar-mini-dot { width:4px; height:4px; }
#dashboardCalendarGrid .calendar-mini-more { font-size:.55rem; }
#dashboardCalendarAgenda { display:grid; gap:10px; margin-top:16px; }
.dashboard-agenda-day { display:grid; grid-template-columns:160px minmax(0,1fr); gap:12px; border-bottom:1px solid var(--line); padding:8px 0; }
.dashboard-agenda-day > button { border:0; background:none; color:var(--gold); font:inherit; font-size:.8rem; text-align:left; align-self:start; cursor:pointer; }
.dashboard-agenda-day ul { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.dashboard-agenda-day li { display:flex; gap:8px; align-items:baseline; font-size:.8rem; overflow-wrap:anywhere; }
.dashboard-agenda-day .calendar-mini-dot { flex:none; }
#dashboardHeroPanel li.goal-is-secret { position:relative; padding-right:30px; }
.goal-secret-lock { position:absolute; top:12px; right:10px; width:10px; height:9px; border:1px solid #dfbe6e; border-radius:2px; }
.dashboard-goal-text { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; line-height:1.45; }
.dashboard-goal-text.is-expanded { display:block; }
.dashboard-goal-toggle { display:block; padding:5px 0 0; border:0; background:none; color:#dfbe6e; font:inherit; font-size:.72rem; cursor:pointer; }
.dashboard-goal-toggle[hidden] { display:none; }
.goal-secret-lock::before { content:""; position:absolute; width:6px; height:6px; border:1px solid #dfbe6e; border-bottom:0; border-radius:5px 5px 0 0; top:-6px; left:1px; }
#dashboardJourneyList, #dashboardJourneyCommentList, #recentLedger { display:block; }
.dashboard-date-group { padding:8px 0 12px; }
.dashboard-date-group > h3 { margin:0 0 12px; color:var(--muted); font-family:var(--font-body); font-size:.78rem; }
#view-dashboard .dashboard-journey-card { display:grid; grid-template-columns:48px minmax(0,1fr) auto; gap:12px; border:0; border-bottom:1px solid var(--line); padding:10px 0; background:none; width:100%; }
#view-dashboard .dashboard-journey-memory img,
#view-dashboard .dashboard-journey-memory .journey-image-placeholder { width:48px; height:48px; min-height:0; object-fit:contain; }
#view-dashboard .dashboard-journey-copy strong { display:inline; font-size:.9rem; }
#view-dashboard .dashboard-journey-copy small { display:inline; margin-left:8px; font-size:.72rem; }
#view-dashboard .dashboard-journey-copy p { margin:4px 0 0; font-size:.78rem; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.dashboard-ledger-row { display:flex; justify-content:space-between; gap:16px; border-left:3px solid #64d5b1; padding:10px 12px; margin-bottom:6px; background:#64d5b106; font-size:.85rem; }
.dashboard-ledger-row.expense { border-left-color:#ee947e; background:#ee947e06; }
.dashboard-ledger-row strong { overflow-wrap:anywhere; }
.dashboard-ledger-row span { color:#64d5b1; white-space:nowrap; }
.dashboard-ledger-row.expense span { color:#ee947e; }
.dashboard-all-read { display:flex; align-items:center; gap:14px; padding:16px; background:#64d5b114; border:1px solid #64d5b133; border-radius:6px; width:100%; }
.dashboard-all-read > span { color:#64d5b1; font-size:1.4rem; }
.dashboard-all-read p { margin:4px 0 0; color:var(--muted); font-size:.8rem; }
@media(max-width:900px) { #dashboardCalendarGrid { grid-template-columns:repeat(12,minmax(0,1fr)); } }
@media(max-width:540px) {
  #dashboardCalendarGrid { grid-template-columns:repeat(9,minmax(0,1fr)); gap:3px; }
  #dashboardCalendarGrid .dashboard-calendar-day { height:37px; }
  .dashboard-agenda-day { grid-template-columns:minmax(0,1fr); gap:8px; }
  #view-dashboard .dashboard-journey-card { grid-template-columns:40px minmax(0,1fr); }
  #view-dashboard .dashboard-journey-memory img { width:40px; height:40px; }
  #view-dashboard .dashboard-journey-card .journey-unread-badge { grid-column:2; }
}

@media (max-width: 1180px) {
  .dashboard-orbit { grid-template-columns: 1fr; }
  /* Only the market lives in this stack: a second track left half the panel empty. */
  .dashboard-side-stack { grid-template-columns: minmax(0, 1fr); }
  .calendar-mini { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

.market-shelf {
  display: grid;
  gap: 14px;
}

.market-shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 8px;
  width: 100%;
}

.dashboard-market-panel,
.dashboard-market-panel .market-shelf,
#dashboardMarketList {
  width: 100%;
}

.market-shelf-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(205, 169, 106, .18);
  border-radius: 3px;
  color: inherit;
  text-align: left;
  background: linear-gradient(140deg, rgba(227, 207, 165, .055), transparent 55%), rgba(3, 10, 14, .44);
}

.market-shelf-item:hover { border-color: rgba(205, 169, 106, .5); transform: translateY(-1px); }
.market-shelf-item.rarity-uncommon { border-color: rgba(175, 103, 43, .52); }
.market-shelf-item.rarity-rare { border-color: rgba(70, 112, 164, .62); }
.market-shelf-item > span:last-child { min-width: 0; }
.market-shelf-item strong,
.market-shelf-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-shelf-item strong { color: #f4e7c8; font-size: .9rem; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; white-space:normal; overflow-wrap:break-word; line-height:1.35; min-height:2.7em; }
.market-shelf-item small { margin-top: 3px; color: rgba(243, 234, 216, .55); font-size: .72rem; }

.market-shelf-icon {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(205, 169, 106, .24);
  border-radius: 50%;
  background: rgba(9, 22, 27, .8);
}

.market-shelf-icon::before { color: #dec898; font-family: var(--font-display); font-size: 1.1rem; }
.market-shelf-icon.icon-potion::before { content: "◒"; }
.market-shelf-icon.icon-weapon::before { content: "†"; }
.market-shelf-icon.icon-armor::before { content: "◇"; }
.market-shelf-icon.icon-arcane::before { content: "✦"; }
.market-shelf-icon.icon-relic::before { content: "◆"; }

.market-shelf footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(205, 169, 106, .18);
  color: rgba(243, 234, 216, .6);
  font-size: .8rem;
}

.market-shelf footer strong { color: #dfc58d; text-align: right; }

.dashboard-market-panel.is-restocking .market-shelf-item { animation: shelf-restock 620ms ease both; }
.dashboard-market-panel.is-restocking .market-shelf-item:nth-child(2n) { animation-delay: 60ms; }
@keyframes shelf-restock { from { opacity: .35; transform: translateY(-7px); } to { opacity: 1; transform: none; } }

.calendar-mini-day.is-past,
.calendar-day-cell.is-past {
  opacity: .52;
  background: rgba(5, 11, 15, .38);
}

.calendar-mini-day.is-past strong,
.calendar-day-cell.is-past strong { text-decoration: line-through; text-decoration-color: rgba(205, 169, 106, .28); }

.calendar-mini-day.is-future,
.calendar-day-cell.is-future {
  color: rgba(219, 232, 242, .76);
  background: linear-gradient(180deg, rgba(155, 187, 215, .055), rgba(7, 14, 20, .7));
}

.calendar-mini-day.today,
.calendar-day-cell.today {
  opacity: 1;
  border-color: rgba(224, 194, 125, .72);
  background:
    radial-gradient(circle at 22% 18%, rgba(126, 230, 191, .2), transparent 44%),
    linear-gradient(145deg, rgba(35, 120, 94, .36), rgba(52, 39, 19, .4));
  box-shadow: inset 0 0 0 1px rgba(111, 215, 177, .28), 0 10px 24px rgba(0, 0, 0, .2);
}

.calendar-mini,
.calendar-grid { overflow-x: hidden; }

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

@media (max-width: 860px) {
  body,
  body.sidebar-collapsed { --sidebar: min(84vw, 320px); }
  body.mobile-nav-open { overflow: hidden; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 140;
    width: var(--sidebar);
    height: 100dvh;
    padding: 18px 16px;
    overflow-y: auto;
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform var(--motion-standard) var(--ease-ritual);
  }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  body.sidebar-collapsed .brand-copy {
    max-width: 190px;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  body.sidebar-collapsed .brand-mark { width: 90px; height: 90px; min-width: 90px; padding: 17px; }
  body.sidebar-collapsed .brand-mark img { width: 58px; height: 58px; }
  body.sidebar-collapsed .nav-button { justify-content: flex-start; gap: 12px; padding-inline: 14px; }
  body.sidebar-collapsed .nav-label { max-width: 190px; opacity: 1; visibility: visible; transform: none; }
  body.sidebar-collapsed .side-status { max-height: 240px; margin-top: auto; padding: 14px; opacity: 1; transform: none; visibility: visible; border-color: rgba(208, 164, 88, 0.34); }
  .sidebar-toggle { display: none; }
  .mobile-nav-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(205, 169, 106, .34);
    border-radius: 50%;
    color: #e7d3a7;
    background: rgba(7, 17, 23, .86);
    transition: transform var(--motion-fast) var(--ease-ritual), color var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease;
  }

  .mobile-nav-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(225, 195, 128, .58);
    background: rgba(36, 99, 84, .28);
  }
  .mobile-nav-toggle span,
  .mobile-nav-toggle span::before,
  .mobile-nav-toggle span::after {
    width: 18px;
    height: 1px;
    display: block;
    content: "";
    background: currentColor;
  }
  .mobile-nav-toggle span { position: relative; }
  .mobile-nav-toggle span::before { position: absolute; top: -6px; }
  .mobile-nav-toggle span::after { position: absolute; top: 6px; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 130;
    border: 0;
    background: rgba(1, 5, 8, .72);
    backdrop-filter: none;
  }
  body.mobile-nav-open .sidebar-scrim { display: block; }
  .topbar { display: flex; flex-direction: row; gap: 14px; }
  .dashboard-hero-card { grid-template-columns: clamp(152px, 24vw, 184px) minmax(0, 1fr); min-height: 0; }
  .dashboard-hero-portrait { padding: 10px; }
  .dashboard-hero-portrait:not(.has-image) { min-height: 220px; }
  .dashboard-hero-sheet { padding: 20px; }
  .dashboard-hero-goals { padding: 18px 20px 20px; }
  .dashboard-hero-identity { align-items: start; flex-direction: column; }
  .dashboard-hero-identity-copy { flex-basis: auto; }
  .dashboard-hero-content,
  .faith-summary,
  .faith-rule-card header,
  .dash-goal-grid,
  .faith-outcomes > div,
  .next-cycle-list,
  .dashboard-journey-grid,
  .dashboard-side-stack { grid-template-columns: 1fr; }
  .calendar-mini { grid-template-columns: repeat(6, minmax(0, 1fr)); max-height: none; }
  .calendar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .calendar-mini-day { min-height: 68px; }
  .market-shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #recentLedger { grid-template-columns: 1fr; }
  .faith-summary { display: grid; }
  .faith-counter { justify-items: start; }
  .faith-compact {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}

@media (max-width: 560px) {
  .workspace { padding: 18px 12px 38px; }
  .dashboard-hero-card { grid-template-columns: 1fr; }
  .dashboard-hero-portrait {
    width: min(240px, calc(100% - 36px));
    margin: 18px 18px 0;
    padding: 10px;
  }
  .dashboard-hero-portrait:not(.has-image) { min-height: 280px; }
  .dashboard-hero-sheet { padding: 18px; }
  .dashboard-hero-goals { padding: 16px 18px 18px; }
  .calendar-mini,
  .calendar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .market-shelf-grid { grid-template-columns: 1fr; }
  .dashboard-journey-card { grid-template-columns: 44px 92px minmax(0, 1fr); gap: 9px; }
  .dashboard-journey-copy p { -webkit-line-clamp: 2; }
}

/* NPC gallery and modal */
.npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.npc-card{position:relative;display:grid;width:100%;min-width:0;min-height:360px;margin:0;overflow:hidden;border:1px solid #29363d;border-left:3px solid var(--disposition-color,#9aa8ad);border-radius:8px;background:#111b21;box-shadow:0 5px 14px rgba(0,0,0,.2)}
.npc-card::before,.npc-card-open::before,.npc-card-open::after{display:none}
.npc-card:hover{box-shadow:0 7px 20px rgba(0,0,0,.3);border-top-color:var(--disposition-color)}
.npc-card-open{display:flex;flex-direction:column;width:100%;min-width:0;padding:0;gap:0;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}
.npc-card .npc-portrait{position:relative;display:grid;place-items:center;width:100%;height:260px;min-height:0;flex-shrink:0;aspect-ratio:auto;overflow:hidden;border:0;border-radius:0;background:linear-gradient(135deg,color-mix(in srgb,var(--disposition-color) 20%,#112329),#18242c);box-shadow:none}
.npc-card .npc-portrait::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,transparent 48%,rgba(17,27,33,.24) 68%,#111b21 100%)}
.npc-card .npc-portrait img{display:block;width:100%;height:100%;min-height:0;object-fit:cover}
.npc-card .npc-portrait>span:not(.npc-disposition-seal){font:500 3rem var(--font-display);color:var(--ink)}
.npc-card .npc-disposition-seal{position:absolute;z-index:1;bottom:14px;left:13px;display:inline-flex;align-items:center;gap:6px;max-width:calc(100% - 26px);padding:4px 8px;border:1px solid color-mix(in srgb,var(--disposition-color) 45%,transparent);border-radius:999px;background:rgba(12,23,26,.86);color:var(--disposition-color);font:700 .68rem/1.3 var(--font-body);overflow-wrap:anywhere}
.npc-disposition-seal i,.npc-disposition-filters i{width:6px;height:6px;flex-shrink:0;border-radius:50%;background:var(--disposition-color)}
.npc-card-copy{display:grid;gap:7px;width:100%;padding:4px 15px 19px}
.npc-card-title{display:block;margin:0;padding:0;min-width:0;border:0;border-radius:0;background:none;box-shadow:none;text-shadow:none;color:var(--ink);font:700 1.1rem/1.2 var(--font-display);text-align:left;overflow-wrap:anywhere}
.npc-card .npc-meta{display:block;position:static;max-width:100%;width:auto;padding:0;border:0;border-radius:0;background:none;justify-self:start;color:var(--brass);font:600 .8rem/1.35 var(--font-body);overflow-wrap:anywhere}
.npc-card-summary{color:var(--muted);font-size:.78rem;line-height:1.5;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.npc-card-actions{position:absolute;z-index:3;top:10px;right:10px;display:flex;gap:6px;opacity:0;pointer-events:none;transition:opacity .16s}
.npc-card:hover .npc-card-actions,.npc-card:focus-within .npc-card-actions{opacity:1;pointer-events:auto}
.npc-card-actions .icon-button{position:static;width:32px;height:32px;background:rgba(9,19,22,.92)}
.npc-disposition-filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 20px}
.npc-disposition-filters button{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:8px 13px;border:1px solid var(--line);border-radius:999px;background:#101a20;color:var(--muted);font:600 .78rem var(--font-body)}
.npc-disposition-filters button.active{border-color:var(--brass);background:#302916;color:#efd095}
.npc-new-face{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:280px;border:1px dashed #3d4c52;border-radius:8px;background:rgba(8,16,19,.4);color:var(--muted);font:500 .8rem var(--font-body)}
.npc-new-face>span:first-child{font-size:2rem;color:var(--brass)}.npc-new-face:hover,.npc-new-face:focus-visible{border-color:var(--brass);color:var(--ink)}
#view-npcs .toolbar.split{grid-template-columns:minmax(0,1fr) minmax(140px,200px)}
.npc-detail-image img{width:100%;height:100%;min-height:0;display:block;object-fit:contain}
#npcModalImagePreview img{width:100%;height:auto;max-height:none;object-fit:contain}
.npc-detail-image>span{min-height:230px;display:grid;place-items:center;color:#fff0c7;font:400 2.4rem var(--font-display)}
@media(hover:none){.npc-card-actions{opacity:1;pointer-events:auto}}
@media(max-width:480px){#view-npcs .toolbar.split{grid-template-columns:1fr}.npc-card-copy{padding:4px 10px 15px}.npc-card-title{font-size:1rem}.npc-card .npc-portrait{height:210px}.npc-card .npc-disposition-seal{left:8px;max-width:calc(100% - 16px)}}

.npc-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.npc-modal[hidden] {
  display: none;
}

body.npc-modal-open {
  overflow: hidden;
}

.npc-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 5, 5, 0.72);
  cursor: pointer;
}

.npc-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  border: 1px solid rgba(231, 197, 123, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(130deg, rgba(205, 169, 106, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(15, 23, 29, 0.99), rgba(6, 12, 17, 0.99));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.66);
  animation: temple-dialog 220ms ease both;
}

@keyframes temple-dialog {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.npc-detail-card {
  display: grid;
  gap: 16px;
  padding: 16px;
}

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

.npc-detail-card h3 {
  margin: 0;
  color: #fff6de;
  font-family: var(--font-display);
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.npc-detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.npc-detail-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(231, 197, 123, 0.24);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.npc-detail-copy {
  display: grid;
  gap: 12px;
  color: rgba(243, 234, 216, 0.76);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.npc-summary {
  color: #fff2cf;
  font-weight: 800;
}

.icon-button[data-action="close-npc-modal"] {
  --icon: var(--icon-close);
}

@media (max-width: 980px) {
  .npc-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

@media (max-width: 680px) {
  .npc-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .npc-card {
    min-height: 360px;
  }

  .npc-card .npc-portrait {
    min-height: 200px;
  }

  .npc-modal {
    padding: 14px;
  }

  .npc-detail-layout,
  .npc-detail-card header {
    grid-template-columns: 1fr;
  }
}

/* Long-form copy: justified with readable measure */
.room-description-text,
.room-bonus-text,
.room-usage-text,
.room-card p,
.source-card p,
.due-card p,
.empty-state p,
.campfire-intro .muted,
.campfire-notes-copy,
.campfire-goal-copy p,
.hero-goal-chip span,
.journey-intro .muted,
.journey-description,
.journey-comment p,
.npc-detail-copy p,
.npc-summary,
.dash-goal p,
.dashboard-hero-card .muted,
.calendar-entry p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  overflow-wrap: anywhere;
}

.form-subsection {
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  margin: 0.25rem 0 0.4rem;
  display: grid;
  gap: 0.65rem;
  background: color-mix(in srgb, var(--panel) 82%, var(--ink-900));
}

.form-subsection legend {
  padding: 0 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--gold-400) 76%, var(--snow-200));
}

.room-upgrade-text {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  color: color-mix(in srgb, var(--snow-100) 90%, var(--line));
}

.room-upgrade-text.warning {
  color: color-mix(in srgb, var(--gold-300) 90%, var(--snow-100));
}

.chip.warning {
  border-color: color-mix(in srgb, var(--gold-500) 70%, var(--line));
  color: color-mix(in srgb, var(--gold-200) 90%, var(--snow-200));
  background: color-mix(in srgb, rgba(51, 30, 7, 0.8) 75%, transparent);
}

.calendar-entry.warning {
  border-color: color-mix(in srgb, var(--gold-500) 56%, var(--line));
}

body.room-upgrade-modal-open {
  overflow: hidden;
}

.room-upgrade-modal-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.room-upgrade-modal-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.room-upgrade-modal-card h3 {
  margin: 0;
}

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

.room-upgrade-modal-col {
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--radius-md);
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 84%, var(--ink-900));
}

.room-upgrade-modal-col p {
  margin: 0 0 8px;
}

.room-upgrade-preview-copy {
  margin-top: 4px;
}

.room-upgrade-modal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .room-upgrade-modal-grid {
    grid-template-columns: 1fr;
  }
}
@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/manrope.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("assets/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Campaign expansion: map, quest board, chronicle and trophy hall. */
.map-floor-controls,.map-zoom-controls,.campaign-toolbar,.button-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.map-viewport,.base-map-viewport{overflow:auto;overscroll-behavior:contain;max-height:72vh;border:1px solid color-mix(in srgb,var(--brass) 40%,var(--line));background:#070d0e;border-radius:8px;scrollbar-gutter:stable}
.base-map-canvas{min-width:680px;position:relative;padding:18px}.base-map-stage{overflow:hidden;position:relative;width:100%;aspect-ratio:var(--map-ratio);transform:scale(var(--map-scale,1));transform-origin:top left;transition:transform .18s ease;user-select:none;touch-action:none;outline:1px solid color-mix(in srgb,var(--brass) 48%,transparent)}.base-map-stage>img{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:fill;background:#0b1111}.map-art-missing{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);background:#101719}.base-map-grid{position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(to right,color-mix(in srgb,var(--frost) 13%,transparent) 1px,transparent 1px),linear-gradient(to bottom,color-mix(in srgb,var(--frost) 13%,transparent) 1px,transparent 1px);background-size:calc(100% / 44) calc(100% / 33)}
.base-map-overlay{position:absolute;left:0;top:0;}
.map-legend{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;margin:12px 0;color:var(--muted);font-size:.82rem}.map-legend-item{display:inline-flex;align-items:center;gap:7px;color:var(--ink)}.map-legend-item::before{content:"";width:18px;height:12px;border:1px solid}.map-legend-item.room::before{border-color:#49c79c;background:rgba(18,112,80,.5)}.map-legend-item.construction::before{border-color:#d0a64d;background:rgba(151,108,35,.5)}.map-legend-help{margin-left:auto}
.base-map-zone,.base-map-selection{position:absolute;box-sizing:border-box;min-width:4px;min-height:4px}.base-map-zone{--zone-color:26,129,92;border:0;outline:2px solid rgb(var(--zone-color));outline-offset:-2px;padding:0;color:var(--ink);overflow:visible;cursor:pointer;background:transparent;box-shadow:0 0 0 1px rgba(0,0,0,.65),inset 0 0 18px rgba(var(--zone-color),.22)}.base-map-zone.construction{--zone-color:169,124,46}.base-map-zone-fill{position:absolute;inset:0;pointer-events:none;background-color:rgba(var(--zone-color),.33);background-image:linear-gradient(to right,rgba(var(--zone-color),.72) 1px,transparent 1px),linear-gradient(to bottom,rgba(var(--zone-color),.72) 1px,transparent 1px);background-size:calc(100% / var(--zone-columns)) calc(100% / var(--zone-rows))}.base-map-zone.status-building .base-map-zone-fill{background-color:rgba(var(--zone-color),.25);background-image:repeating-linear-gradient(135deg,rgba(var(--zone-color),.42) 0 5px,transparent 5px 10px),linear-gradient(to right,rgba(var(--zone-color),.7) 1px,transparent 1px),linear-gradient(to bottom,rgba(var(--zone-color),.7) 1px,transparent 1px);background-size:auto,calc(100% / var(--zone-columns)) calc(100% / var(--zone-rows)),calc(100% / var(--zone-columns)) calc(100% / var(--zone-rows))}.base-map-zone.status-inactive{filter:saturate(.35);opacity:.72}.base-map-zone-label{position:absolute;left:4px;top:4px;z-index:1;display:grid;max-width:calc(100% - 8px);padding:3px 5px;background:rgba(4,10,10,.84);border-left:2px solid rgb(var(--zone-color));text-align:left;pointer-events:none}.base-map-zone-label strong,.base-map-zone-label em{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 2px #000}.base-map-zone-label strong{font:700 11px/1.2 var(--font-body)}.base-map-zone-label em{font-size:9px;opacity:.82}.base-map-zone:hover,.base-map-zone:focus-visible{z-index:3;box-shadow:0 0 0 2px var(--ink),0 0 16px rgba(var(--zone-color),.55)}.base-map-selection{pointer-events:none;border:2px dashed var(--ink);background:rgba(242,235,210,.18);box-shadow:inset 0 0 0 1px #111}
.map-zone-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin-top:14px}.map-zone-list-item{text-align:left;padding:10px;border:1px solid var(--line);background:var(--surface);color:inherit;border-radius:6px}.map-zone-list-item span{display:block;color:var(--muted);font-size:.85rem;margin-top:3px}
.campaign-modal{position:fixed;z-index:80;inset:0;display:grid;place-items:center;padding:20px;background:rgba(2,7,8,.76)}.campaign-modal[hidden]{display:none}.campaign-modal-card{width:min(760px,100%);max-height:min(88vh,850px);overflow:auto;padding:20px;border:1px solid var(--brass);border-radius:8px;background:var(--surface-2);box-shadow:0 20px 60px rgba(0,0,0,.5)}.campaign-modal-card>header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.campaign-modal-open{overflow:hidden}

.mission-grid{background:linear-gradient(rgba(9,6,4,.2),rgba(9,6,4,.45)),repeating-linear-gradient(90deg,#24170f 0 3px,#2d1e13 3px 82px,#1b120c 82px 85px);border:5px solid #17100b;box-shadow:inset 0 0 0 1px #725534,inset 0 0 36px #050302;padding:22px;border-radius:5px}.quest-board{display:grid;gap:24px}.quest-board-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.quest-column{min-width:0}.quest-column>header,.rumor-board>header{display:flex;align-items:center;gap:9px;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid rgba(214,175,103,.38)}.quest-column>header h3,.rumor-board h3{margin:0;color:#ead9ad;font-size:1rem}.quest-column>header span,.rumor-board>header>span{margin-left:auto;color:#d0b47d;font:600 .78rem var(--font-mono)}.quest-column>div,.rumor-strip{display:grid;gap:13px}.quest-notice{content-visibility:auto;contain-intrinsic-size:220px;position:relative;padding:20px 14px 14px;color:#282117;background:#d7c9a5;background-image:linear-gradient(105deg,rgba(255,255,255,.16),transparent 38%),repeating-linear-gradient(0deg,rgba(64,45,24,.035) 0 1px,transparent 1px 5px);border:1px solid #927548;border-radius:2px;box-shadow:2px 4px 8px rgba(0,0,0,.42);transform:rotate(-.25deg)}.quest-notice:nth-child(even){transform:rotate(.3deg);background-color:#cfc09e}.quest-notice.rumor{background-color:#c6c0ae;border-color:#797064}.quest-pin{position:absolute;top:7px;left:50%;width:9px;height:9px;border-radius:50%;background:#9b2d24;box-shadow:inset 1px 1px 2px #f0a387,0 2px 3px #3d160f}.quest-notice header{display:flex;justify-content:space-between;align-items:center;gap:8px}.quest-notice header>p{margin:0;color:#705a35;font:700 .68rem var(--font-mono);text-transform:uppercase}.quest-notice .card-actions{display:flex;gap:5px}.quest-notice .icon-button{position:static;width:28px;height:28px;color:#3e3020;border-color:#8c744d;background:rgba(255,255,255,.14)}.quest-notice h4{margin:8px 0;font:700 1rem/1.2 var(--font-display);color:#21180f}.quest-notice>p{margin:8px 0;color:#3a3024;font-size:.88rem}.quest-notice-meta{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.quest-notice-meta span{padding:2px 5px;border:1px solid rgba(83,62,32,.35);font-size:.67rem;color:#5b492f}.quest-column-empty{margin:0;padding:14px;border:1px dashed rgba(214,175,103,.3);color:#b6a991;text-align:center;font-size:.83rem}.rumor-board{padding-top:18px;border-top:2px solid rgba(14,8,4,.7)}.rumor-board>header .eyebrow{margin:0 8px 0 0}.rumor-strip{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.timeline-horizontal-scroll{overflow-x:auto;overscroll-behavior-inline:contain;padding:10px 0 20px;scrollbar-gutter:stable}
.campaign-chronicle-horizontal{display:flex;width:max-content;min-width:100%;height:390px}
.timeline-era-segment{position:relative;flex:0 0 var(--era-width);display:flex;align-items:center;padding-left:90px;isolation:isolate}
.timeline-era-segment::before{content:"";position:absolute;left:0;right:0;top:50%;height:2px;background:linear-gradient(90deg,var(--brass),#60736a);z-index:-1}
.timeline-era-marker{position:absolute;left:0;top:calc(50% - 28px);width:82px;text-align:center}
.timeline-era-marker>span{display:grid;place-items:center;width:56px;height:56px;margin:auto;border:2px solid var(--brass);border-radius:50%;background:#101c1b;color:var(--brass);font:700 1.2rem var(--font-display)}
.timeline-era-marker h2{margin:10px 0 0;font-size:1rem;white-space:nowrap}
.timeline-era-events{display:flex;align-items:center;gap:20px;height:100%}
.timeline-node{position:relative;flex:0 0 160px;height:100%;border:0;padding:0;background:transparent;color:var(--ink);cursor:pointer;text-align:center}
.timeline-node-dot{position:absolute;top:calc(50% - 7px);left:calc(50% - 7px);width:14px;height:14px;border:2px solid var(--brass);border-radius:50%;background:#101b1b;box-shadow:0 0 0 5px #111b1b;transition:background .16s,box-shadow .16s}
.timeline-node.type-discovery .timeline-node-dot{border-color:var(--emerald)}.timeline-node.type-decision .timeline-node-dot{border-color:var(--violet)}
.timeline-node::before{content:"";position:absolute;left:50%;top:calc(50% - 26px);width:1px;height:26px;background:var(--brass)}.timeline-node.below::before{top:50%}
.timeline-node-label{position:absolute;left:0;right:0;bottom:calc(50% + 28px);display:grid;gap:7px;overflow-wrap:anywhere}
.timeline-node.below .timeline-node-label{bottom:auto;top:calc(50% + 28px)}
.timeline-node-label small{font:500 .67rem var(--font-mono);color:var(--brass)}.timeline-node-label strong{font:700 .9rem/1.3 var(--font-display);text-transform:none}
.timeline-node:hover .timeline-node-dot,.timeline-node:focus-visible .timeline-node-dot{background:var(--brass);box-shadow:0 0 0 5px #111b1b,0 0 14px #b28c3b}
.timeline-add-node{flex:0 0 38px;height:38px;border:1px dashed var(--brass);border-radius:50%;background:#101a1c;color:var(--brass);font:400 1.5rem var(--font-body);cursor:pointer}
.timeline-entry-dialog{width:min(680px,calc(100% - 28px));max-height:85vh;padding:24px;border:1px solid var(--brass);border-radius:8px;background:var(--surface-2);color:var(--ink);overflow:auto}
.timeline-entry-dialog::backdrop{background:rgba(2,7,8,.8)}#timelineEntryDetail>header{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}#timelineEntryDetail h2{font-size:1.5rem;text-transform:none;overflow-wrap:anywhere}#timelineEntryDetail .icon-button{position:static;flex-shrink:0}#timelineEntryDetail .icon-button::before{content:"×";mask:none;background:none;font:24px var(--font-body);color:var(--ink)}
.timeline-detail-date{color:var(--brass);font:500 .85rem var(--font-mono)}.timeline-detail-text{line-height:1.65;overflow-wrap:anywhere}#timelineEntryDetail>footer{margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
.date-preview{display:block;margin-top:5px;color:var(--brass);font-size:.76rem}

.timeline-horizontal-scroll { scrollbar-width:none; }
.timeline-horizontal-scroll::-webkit-scrollbar { display:none; }
.timeline-node { touch-action:none; user-select:none; }
.timeline-node.is-dragging { z-index:10; opacity:.8; cursor:grabbing; }
.timeline-drop-target { outline:2px dashed var(--emerald); outline-offset:3px; }
.timeline-pan-controls { display:flex; justify-content:flex-end; gap:8px; margin-bottom:8px; }
.timeline-pan-controls button { width:40px; height:40px; border:1px solid var(--line); border-radius:5px; background:var(--surface); color:var(--ink); font-size:1.3rem; cursor:pointer; }
#missionForm label[hidden] { display:none; }












#missionList { background:#0b161b; border:1px solid var(--line); box-shadow:none; }
#missionList .quest-notice { --status-color:#dbbb76; color:var(--ink); background:#142127; border:1px solid var(--line); border-left:3px solid var(--status-color); border-radius:6px; transform:none; box-shadow:0 3px 8px #0002; padding:14px; }
#missionList .quest-notice.status-active { --status-color:#68c9a9; }
#missionList .quest-notice.status-completed { --status-color:#88aec4; }
#missionList .quest-notice.status-failed { --status-color:#df947f; }
#missionList .quest-notice.rumor { --status-color:#ab9bc7; }
#missionList .quest-pin { display:none; }
#missionList .quest-notice h4 { color:var(--ink); }
#missionList .quest-notice > p { color:var(--muted); }
#missionList .quest-notice header > p { color:var(--status-color); }
#missionList .quest-notice-meta span { color:var(--muted); border-color:var(--line); }
#missionList .icon-button { color:var(--ink); background:#09151c; border-color:var(--line); }
#missionList .quest-column > header > span,
#missionList .rumor-board > header > span { display:grid; place-items:center; min-width:28px; height:28px; padding:0 7px; border:1px solid #d2af6555; border-radius:50%; background:#d2af6514; color:#ebd298; }
.trophy-wall-panel{overflow:hidden;background:linear-gradient(135deg,rgba(204,164,83,.025),transparent 42%),var(--surface-2)}
.trophy-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:12px;margin-bottom:18px}.trophy-filter-chips{display:flex;flex-wrap:wrap;gap:7px}.trophy-filter-chips button{min-height:40px;padding:7px 14px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--muted);font:600 .78rem var(--font-body);cursor:pointer;transition:border-color .16s ease,background-color .16s ease,color .16s ease,transform .16s ease}.trophy-filter-chips button:hover{color:var(--ink);border-color:var(--brass)}.trophy-filter-chips button.active{color:#f3ddb0;border-color:#b98b29;background:#241d0c;box-shadow:inset 0 0 0 1px rgba(224,179,76,.16)}
.trophy-gallery{container-type:inline-size;position:relative;overflow:hidden;border:1px solid #403a31;border-radius:7px;background-color:#0b1012;background-image:linear-gradient(rgba(4,8,9,.34),rgba(4,8,9,.7)),repeating-linear-gradient(0deg,transparent 0 37px,rgba(196,185,157,.025) 38px 39px),repeating-linear-gradient(90deg,rgba(176,163,134,.025) 0 1px,transparent 1px 54px);box-shadow:inset 0 0 48px rgba(0,0,0,.52)}.trophy-hall{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr));grid-auto-flow:dense;gap:22px;padding:28px}.trophy-card{--trophy-accent:#8497a6;--trophy-deep:#173243;position:relative;min-width:0;min-height:340px;overflow:hidden;border:1px solid color-mix(in srgb,var(--trophy-accent) 58%,#1c252a);border-radius:8px;background:#11191e;box-shadow:0 12px 22px rgba(0,0,0,.25);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.trophy-card.rarity-epic{--trophy-accent:#51c7a2;--trophy-deep:#105b49}.trophy-card.rarity-legendary{--trophy-accent:#e1b548;--trophy-deep:#7d211b}.trophy-card:hover,.trophy-card:focus-within{transform:translateY(-2px);border-color:var(--trophy-accent);box-shadow:0 15px 26px rgba(0,0,0,.34),0 0 18px color-mix(in srgb,var(--trophy-accent) 15%,transparent)}.trophy-card.featured{grid-column:span 2;min-height:360px}.trophy-card-main{display:grid;grid-template-rows:minmax(190px,1fr) auto;width:100%;height:100%;padding:0;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}.trophy-art{position:relative;display:grid;place-items:center;min-height:190px;overflow:hidden;background:radial-gradient(circle at 50% 72%,color-mix(in srgb,var(--trophy-accent) 26%,transparent),transparent 48%),linear-gradient(150deg,var(--trophy-deep),#15202a 68%,#0e1519)}.trophy-card.featured .trophy-art{min-height:215px}.trophy-art::after{content:"";position:absolute;inset:auto 0 0;height:38%;background:linear-gradient(transparent,#11191e);pointer-events:none}.trophy-art img{position:relative;z-index:1;display:block;width:100%;height:220px;padding:16px;object-fit:contain;filter:drop-shadow(0 8px 8px rgba(0,0,0,.62))}.trophy-card.featured .trophy-art img{height:250px}.trophy-placeholder{position:relative;z-index:1;display:grid;place-items:center;color:var(--trophy-accent);font-size:4.5rem;text-shadow:0 0 18px color-mix(in srgb,var(--trophy-accent) 42%,transparent)}.trophy-rarity{position:absolute;z-index:3;top:12px;left:12px;display:flex;align-items:center;gap:6px;padding:5px 9px;border:1px solid color-mix(in srgb,var(--trophy-accent) 62%,transparent);border-radius:999px;background:color-mix(in srgb,var(--trophy-deep) 80%,#101719);color:var(--trophy-accent);font:700 .68rem var(--font-body);box-shadow:0 3px 10px rgba(0,0,0,.3)}.trophy-rarity b{font-size:.8rem}.trophy-spark{position:absolute;z-index:2;right:18px;bottom:18px;color:#ffe8a3;font-size:1.35rem;font-style:normal;text-shadow:0 0 10px #e8b63d}.trophy-card-body{position:relative;z-index:2;display:grid;gap:9px;padding:17px 17px 15px;border-top:1px solid color-mix(in srgb,var(--trophy-accent) 24%,#243039);background:#11191e}.trophy-card-body>strong{color:var(--ink);font:700 1.05rem/1.2 var(--font-display);text-transform:none}.trophy-context{color:var(--muted);font-size:.83rem;line-height:1.45}.trophy-meta{display:flex;flex-wrap:wrap;gap:8px 16px;padding-top:9px;border-top:1px solid #27333a;color:#80909a;font-size:.72rem}.trophy-meta span::before{content:"◆";margin-right:6px;color:var(--trophy-accent);font-size:.55rem}.trophy-card>.card-actions{position:absolute;z-index:5;top:10px;right:10px;display:flex;gap:5px;opacity:0;pointer-events:none;transform:translateY(-3px);transition:opacity .15s ease,transform .15s ease}.trophy-card:hover>.card-actions,.trophy-card:focus-within>.card-actions{opacity:1;pointer-events:auto;transform:none}.trophy-card>.card-actions .icon-button{position:static;width:30px;height:30px;color:var(--ink);border-color:color-mix(in srgb,var(--trophy-accent) 55%,#4a453c);background:rgba(10,15,17,.9)}
.trophy-empty-hook{display:grid;place-items:center;align-content:center;gap:8px;min-height:270px;border:1px dashed #334047;border-radius:8px;color:#43515a;background:rgba(8,13,15,.32);text-align:center}.trophy-empty-hook span{font-size:1.55rem;opacity:.62}.trophy-empty-hook small{font-size:.72rem}.trophy-filter-empty{display:grid;place-items:center;gap:5px;margin:-8px 28px 28px;padding:16px;border:1px dashed #3b484e;color:var(--muted);text-align:center}.trophy-filter-empty strong{color:var(--ink)}.trophy-filter-empty span{font-size:.8rem}.trophy-detail img{display:block;max-width:100%;max-height:48vh;object-fit:contain;margin:12px auto}
.journey-category{font-size:.75rem;color:var(--brass)}
#roomList .room-thumbnail{height:auto;aspect-ratio:1;align-self:start}#roomList .room-thumbnail img{object-fit:cover}
#npcList .npc-portrait{height:auto;min-height:0;aspect-ratio:1}
.portrait-crop-editor{display:grid;grid-template-columns:minmax(0,240px) minmax(140px,1fr);gap:18px;width:100%;align-items:center}.portrait-crop-window{position:relative;width:100%;aspect-ratio:1;overflow:hidden;background:#101b20;border-radius:6px}.image-preview .portrait-crop-window img,#npcModalImagePreview .portrait-crop-window img{position:absolute;inset:0;display:block;width:100%;height:100%;max-height:none;object-fit:cover}.portrait-crop-controls{display:grid;gap:12px;text-align:left}.portrait-crop-controls label{display:grid;gap:5px;font-size:.8rem}.portrait-crop-controls input{width:100%;padding:0;accent-color:var(--emerald)}
@media(max-width:480px){.portrait-crop-editor{grid-template-columns:1fr}.portrait-crop-window{max-width:240px;margin:auto}}
.hero-trophy-badges{display:flex;flex-wrap:wrap;gap:8px;margin:0;min-width:0;max-width:312px;flex:0 1 auto}.hero-trophy-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 72px;width:72px;height:72px;padding:4px;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--ink);font:600 .72rem/1.3 var(--font-body);text-align:left;transition:filter .16s}.hero-trophy-badge{--badge-glow:rgba(211,180,105,.7)}.hero-trophy-badge.rarity-epic{--badge-glow:rgba(79,204,159,.7)}.hero-trophy-badge:hover,.hero-trophy-badge:focus-visible{background:transparent;box-shadow:none;outline:none;filter:drop-shadow(0 0 5px var(--badge-glow)) drop-shadow(0 0 9px var(--badge-glow))}.hero-trophy-badge img{width:64px;height:64px;flex-shrink:0;object-fit:contain}.hero-trophy-icon{display:block;width:48px;height:48px;flex-shrink:0;background:var(--brass);mask:var(--icon-trophies) center/contain no-repeat}
.trophy-recipient-field{margin:0;padding:14px;border:1px solid var(--line);border-radius:6px}.trophy-recipient-field legend{padding:0 6px;font-weight:700}#trophyRecipientOptions{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px;margin-top:12px}.trophy-recipient-field .checkbox-row{display:flex;align-items:center;gap:8px;min-height:36px}.trophy-recipient-field input[type=checkbox]{width:18px;height:18px;flex-shrink:0}
@container(max-width:560px){.trophy-card.featured{grid-column:span 1}}
@media(max-width:900px){.quest-board-columns{grid-template-columns:1fr}.map-legend-help{width:100%;margin-left:0}}
@media(max-width:768px){.base-map-canvas{min-width:560px;padding:10px}.map-viewport,.base-map-viewport{max-height:58vh}.campaign-modal{padding:10px}.campaign-modal-card{padding:15px}.mission-grid{padding:14px}.trophy-toolbar{grid-template-columns:1fr}.trophy-filter-chips{overflow-x:auto;flex-wrap:nowrap;padding-bottom:3px}.trophy-hall{grid-template-columns:1fr;padding:16px}.trophy-card.featured{grid-column:span 1}}
@media(hover:none){.trophy-card>.card-actions{opacity:1;pointer-events:auto;transform:none}}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Shared interaction treatment: feedback without layout animation. */
.save-status { position:fixed; right:18px; bottom:14px; z-index:40; padding:5px 9px; border:1px solid var(--line); border-radius:4px; background:#0c191a; color:var(--muted); font:500 .75rem var(--font-body); pointer-events:none; }
.save-status[data-status="pending"] { color:var(--brass); }
.save-status[data-status="saved"] { color:#82cbb2; }
:where(button, a, input, select, textarea):focus-visible { outline:2px solid var(--brass); outline-offset:3px; }
:where(.card-actions, .room-maintenance-actions, .journey-card-actions) { transition:opacity 160ms ease, transform 160ms ease; }
@media (hover:none), (pointer:coarse) {
  :where(.card-actions, .room-maintenance-actions, .journey-card-actions) { opacity:1; pointer-events:auto; transform:none; }
  .icon-button { min-width:40px; min-height:40px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  .card-actions, .room-maintenance-actions, .journey-card-actions { transition:none; }
}

/* Mercado: etiquetas de loja e ciclo de renovação. */
#marketStatus { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; }
#marketStatus .chip.premium { color:#f4d99b; border-color:rgba(205,169,106,.48); background:rgba(205,169,106,.13); }
#marketStatus .chip.income { color:#c4efd9; border-color:rgba(76,167,124,.46); background:rgba(51,127,92,.16); }
.market-restock-clock { flex:1 1 250px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 14px; min-width:min(100%,250px); padding:10px 12px; border:1px solid rgba(132,158,170,.34); border-radius:5px; background:rgba(24,39,47,.56); color:#aebfc8; }
.market-restock-clock.is-due { border-color:rgba(205,169,106,.56); background:rgba(71,55,26,.34); }
.market-restock-clock-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; grid-column:1 / -1; font:700 .73rem/1.2 var(--font-mono); }
.market-restock-clock-head strong { color:#f1d79a; }
.market-restock-clock small { color:rgba(211,225,231,.7); font-size:.72rem; }
.market-restock-track { grid-column:1 / -1; height:6px; overflow:hidden; border-radius:99px; background:rgba(3,10,14,.7); box-shadow:inset 0 1px 2px rgba(0,0,0,.42); }
.market-restock-track span { display:block; width:var(--market-restock-progress); height:100%; border-radius:inherit; background:linear-gradient(90deg,#4b9073,#d0a458); transition:width .28s ease; }
.market-card .market-price-tag { display:flex; flex-wrap:wrap; align-items:center; gap:7px 10px; margin-top:auto; padding:10px 0 2px; border-top:1px solid rgba(205,169,106,.18); }
.market-price-original { color:rgba(219,228,230,.58); font-size:.78rem; }
.market-price-original s { text-decoration-color:rgba(205,169,106,.72); text-decoration-thickness:1px; }
.market-price-final { color:#f5dfad; font:700 1.2rem/1 var(--font-display); }
.market-adjustment { margin-left:auto; padding:4px 7px; border:1px solid; border-radius:999px; font:700 .67rem/1 var(--font-mono); }
.market-adjustment.is-discount { color:#c5efdb; border-color:rgba(68,158,115,.5); background:rgba(46,119,83,.17); }
.market-adjustment.is-premium { color:#f5d89c; border-color:rgba(205,169,106,.5); background:rgba(129,94,31,.17); }
.market-card.rarity-uncommon { border-color:rgba(205,169,106,.68); background:linear-gradient(145deg,rgba(127,91,35,.2),rgba(10,20,27,.94) 58%),rgba(12,20,27,.9); }
.market-card.rarity-uncommon::after { background:radial-gradient(circle,rgba(205,169,106,.16),transparent 64%); }
.market-card.rarity-rare { border-color:rgba(111,145,158,.72); background:linear-gradient(160deg,rgba(79,112,127,.2),rgba(255,255,255,.016) 42%,rgba(61,81,91,.16)),rgba(12,20,27,.9); }
.market-card.rarity-rare::after { background:radial-gradient(circle,rgba(111,145,158,.18),transparent 62%); }
.market-card.rarity-rare h3 { color:#d7e4e8; }
.market-card.rarity-uncommon h3 { color:#f4d99b; }
.market-card.rarity-uncommon .market-rarity-chip { color:#f4d99b; border-color:rgba(205,169,106,.52); background:rgba(126,91,35,.18); }
.market-card.rarity-rare .market-rarity-chip { color:#d7e4e8; border-color:rgba(111,145,158,.52); background:rgba(61,83,94,.28); }
.market-link { display:inline-flex; align-items:center; gap:6px; width:fit-content; color:#c5efdb; }
.market-external-icon { display:inline-grid; place-items:center; width:1.1em; height:1.1em; border:1px solid currentColor; border-radius:2px; font:700 .72em/1 var(--font-mono); }
@media (max-width:620px) { .market-restock-clock { flex-basis:100%; } .market-adjustment { margin-left:0; } }
