:root {
  --vellum: #D8E0EE;
  --vellum-panel: #F0F3FA;
  --ink: #16233F;
  --ink-soft: #3D4E70;
  --gold: #B8922E;
  --gold-light: #D4AF37;
  --royal: #1B2E5C;
  --crimson: #8B1E2E;
  --moss: #2E6B3E;
  --warn: #a8631a;
  --border: #AEC0DD;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--vellum);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, .display {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

h1 { font-size: 34px; margin: 0 0 4px; }
h2 {
  font-size: 22px;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  color: var(--royal);
}

h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--gold-light);
  color: var(--royal);
  letter-spacing: 0.01em;
}

h4 {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

a { color: var(--gold); }

.shell {
  max-width: 1800px;
  margin: 0 auto;
  padding: 24px 40px 64px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 8px;
}

.masthead .subtitle { color: var(--ink-soft); font-size: 14px; }

nav.tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0 20px;
  border-bottom: 1px solid var(--border);
}

nav.tabs a {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  border-bottom: 2px solid transparent;
}

nav.tabs a.active, nav.tabs a:hover {
  color: var(--ink);
  border-bottom-color: var(--gold);
}


.panel {
  background: var(--vellum-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--ink-soft); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.status-secure { background: #e3ecdf; color: var(--moss); }
.status-thin { background: #f3e6d1; color: var(--warn); }
.status-deficit { background: #f5dde1; color: var(--crimson); }

.region-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(212,175,55,0.18);
  color: var(--gold-light);
  border: 1px solid rgba(212,175,55,0.4);
}

.num-pos { color: var(--moss); }
.num-neg { color: var(--crimson); }
.cell-deficit { background: #f5dde1; font-weight: 600; }

.flash {
  background: var(--vellum-panel);
  border-left: 3px solid var(--gold);
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input, select, button {
  font-family: inherit;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #FAFBFE;
  color: var(--ink);
}

/* Many number inputs across this project were given inline widths (some
   as narrow as 50-60px) that don't comfortably fit 5 digits at this font
   size. This overrides any inline width below the minimum, without
   touching ones already wide enough - !important is needed since an
   inline style="" attribute otherwise always wins over a stylesheet rule
   regardless of selector specificity. */
input[type="number"] {
  min-width: 70px !important;
  box-sizing: border-box;
}

button {
  background: var(--ink);
  color: var(--vellum-panel);
  border-color: var(--ink);
  cursor: pointer;
}
button:hover { background: var(--gold); border-color: var(--gold); }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.field-grid label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }

.muted { color: var(--ink-soft); font-size: 13px; }

/* ============================================================
   Settlement page - fancier FRPG styling, scoped to .settlement-page
   so it never bleeds into other pages. Stays within the existing
   King Blue + Red Moon Crimson palette (no new colors introduced) and
   the existing Cormorant Garamond / Inter font pairing (no new fonts,
   no body-text or table size changes - only headers get bigger and
   more ornamented, per the request).
   ============================================================ */

.settlement-page .hero-banner {
  position: relative;
  background: linear-gradient(135deg, var(--royal) 0%, #0F1930 100%);
  border-radius: 8px 8px 0 0;
  padding: 30px 40px 26px;
  border-bottom: 3px solid var(--gold);
  overflow: hidden;
}
/* A faint heraldic diamond lattice, drawn entirely in CSS (no image
   assets) - subtle enough not to compete with the name or fight
   readability, just texture behind it. */
.settlement-page .hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(184,146,46,0.07) 25%, transparent 25%, transparent 75%, rgba(184,146,46,0.07) 75%),
    linear-gradient(45deg, rgba(184,146,46,0.07) 25%, transparent 25%, transparent 75%, rgba(184,146,46,0.07) 75%);
  background-size: 34px 34px;
  background-position: 0 0, 17px 17px;
  pointer-events: none;
}
.settlement-page .hero-banner .hero-content { position: relative; z-index: 1; }

.settlement-page .hero-banner h2.settlement-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 46px;
  line-height: 1.1;
  color: var(--gold-light);
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
  margin: 0 0 6px;
  letter-spacing: 0.015em;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.settlement-page .hero-banner .settlement-name .flourish {
  color: var(--gold);
  font-size: 0.5em;
  opacity: 0.85;
}
.settlement-page .hero-banner .hero-meta {
  color: #B9C4DE;
  font-size: 14px;
  margin: 0;
}
.settlement-page .hero-banner .status-pill {
  vertical-align: middle;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Section headers - each panel's h3 becomes a full-width banner strip
   bled to the panel's own edges via negative margins, matching this
   project's existing padding (20px 24px on .panel). A small diamond
   glyph stands in for a heraldic mark since no image assets are
   available - restrained, not a full icon set. */
.settlement-page .panel {
  padding-top: 0;
  overflow: hidden;
}
.settlement-page .panel > h3:first-child {
  position: relative;
  margin: 0 -24px 18px;
  padding: 13px 24px 11px 42px;
  background: linear-gradient(90deg, var(--royal) 0%, #223A6E 60%, var(--royal) 100%);
  color: var(--gold-light);
  border-bottom: 2px solid var(--gold);
  font-size: 20px;
  letter-spacing: 0.025em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.settlement-page .panel > h3:first-child::before {
  content: "\25C6"; /* diamond */
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 13px;
}

/* Sub-headers (h4) inside a settlement panel get a light left rule
   instead of the all-caps label style elsewhere, so they still read as
   a step down from the h3 banner without competing with it. */
.settlement-page .panel h4 {
  border-left: 3px solid var(--gold-light);
  padding-left: 10px;
  margin-top: 20px;
}

/* A slim gold rule between stacked panels, echoing the h2 underline
   used elsewhere, to give the page a bit of ceremonial rhythm without
   touching spacing that already works. */
.settlement-page .panel + .panel { margin-top: -4px; }
.settlement-page .panel {
  border-color: var(--border);
  box-shadow: 0 1px 0 rgba(27,46,92,0.05);
}
