:root {
  font-family: Georgia, "Times New Roman", serif;
  color: #d8cdb7;
  background: #090807;
  --ink: #0a0908;
  --iron: #171512;
  --iron-2: #211d17;
  --iron-3: #2c261d;
  --edge: #5d4b33;
  --edge-soft: #30281f;
  --parchment: #c8b78f;
  --muted: #827866;
  --blood: #8f3b31;
  --cold: #6e8090;
  --green: #6d7f59;
  --house: #b88a43;
  --house-rgb: 184,138,67;
  --house-metal: #70512c;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #080706; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(0,0,0,.48), rgba(0,0,0,.48)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(0deg, #0c0a08 0 2px, #090807 2px 5px);
}
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  pointer-events: none;
}
body::before {
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(var(--house-rgb), .07), transparent 27rem),
    radial-gradient(circle at 82% 12%, rgba(112, 74, 36, .08), transparent 24rem),
    radial-gradient(ellipse at 50% 100%, rgba(85, 45, 24, .12), transparent 45rem);
}
body::after {
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(115deg, transparent 0 46%, rgba(255,255,255,.018) 47%, transparent 48%),
    linear-gradient(65deg, transparent 0 47%, rgba(0,0,0,.32) 48%, transparent 49%);
  background-size: 34px 34px, 51px 51px;
  mix-blend-mode: overlay;
}

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 1px solid var(--house); outline-offset: 2px; }
.hidden { display: none !important; }

.site-shell { min-height: 100vh; position: relative; isolation: isolate; }
.world-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.84), transparent 17%, transparent 83%, rgba(0,0,0,.84)),
    linear-gradient(180deg, rgba(0,0,0,.2), transparent 28%, rgba(0,0,0,.58));
}

/* Header: engraved title bar rather than a SaaS hero. */
.site-header {
  position: relative;
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto minmax(70px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(16px, 3vw, 44px);
  border-bottom: 1px solid #3f3123;
  background:
    linear-gradient(180deg, rgba(32,27,21,.98), rgba(12,11,9,.98)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px);
  box-shadow: 0 12px 35px rgba(0,0,0,.62), inset 0 -1px rgba(255,255,255,.035);
}
.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #4b3827 12%, var(--house-metal) 50%, #4b3827 88%, transparent);
}
.site-header::before { top: 0; }
.site-header::after { bottom: 0; opacity: .55; }
.header-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, #5f4a31 28%, rgba(var(--house-rgb), .7));
  position: relative;
}
.header-rule::after {
  content: "◆";
  position: absolute;
  right: -7px;
  top: -8px;
  color: var(--house);
  font-size: 11px;
}
.header-rule.right { transform: scaleX(-1); }
.wordmark { min-width: 250px; text-align: center; line-height: 1; text-transform: uppercase; }
.wordmark > span { display: block; color: #9e8e73; letter-spacing: .42em; font-size: 9px; margin-left: .42em; }
.wordmark h1 {
  margin: 3px 0 4px;
  color: #e0d1b5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 500;
  letter-spacing: .055em;
  text-shadow: 0 2px #000, 0 0 18px rgba(var(--house-rgb), .15);
}
.wordmark small { color: var(--house); font-size: 9px; letter-spacing: .21em; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.patch-badge {
  padding: 7px 10px;
  color: #9b907b;
  border-left: 1px solid #5a4730;
  border-right: 1px solid #5a4730;
  font: 10px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .05em;
}
.rune-button {
  position: relative;
  min-height: 34px;
  padding: 7px 16px;
  border: 1px solid #755c36;
  border-radius: 0;
  background: linear-gradient(#5b3d20, #28190f);
  box-shadow: inset 0 1px rgba(255,255,255,.08), inset 0 -2px #0b0805;
  color: #dfcfad;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .12em;
  font: 10px/1 Georgia, serif;
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
}
.rune-button:hover { filter: brightness(1.18); }
.rune-button.quiet { background: linear-gradient(#27231d, #12100d); border-color: #4a3e2d; color: #a99b82; }

/* Main layout */
.planner-layout {
  width: min(1770px, calc(100% - 28px));
  margin: 18px auto 24px;
  display: grid;
  grid-template-columns: 250px minmax(690px, 1fr) 318px;
  align-items: start;
  gap: 12px;
}
.poe-frame {
  position: relative;
  border: 1px solid #4e3e2a;
  background:
    linear-gradient(180deg, rgba(27,24,20,.985), rgba(10,9,8,.99)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.01) 0 2px, transparent 2px 6px);
  box-shadow:
    0 18px 42px rgba(0,0,0,.56),
    inset 0 0 0 1px #080706,
    inset 0 0 34px rgba(0,0,0,.35);
}
.poe-frame::before,
.poe-frame::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 18px;
  height: 18px;
  pointer-events: none;
  border-color: #84633b;
  border-style: solid;
}
.poe-frame::before { left: 4px; top: 4px; border-width: 1px 0 0 1px; }
.poe-frame::after { right: 4px; bottom: 4px; border-width: 0 1px 1px 0; }
.frame-title {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #493a29;
  background:
    linear-gradient(180deg, #2b241a, #15120e),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255,255,255,.018) 7px 8px);
  color: var(--house);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 9px;
}
.frame-title::before { content: "◈"; color: #6a5336; margin-right: 3px; }
.frame-title > span { flex: 1; }
.frame-title > strong { color: #857a67; font: 9px ui-monospace, monospace; }

/* Contract dossier */
.contract-panel { position: sticky; top: 12px; overflow: hidden; }
.contract-art {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid #3b3023;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--house-rgb), .23), transparent 39%),
    linear-gradient(160deg, #242019, #0b0a08 66%);
}
.contract-art::before {
  content: "";
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(var(--house-rgb), .2);
  transform: rotate(45deg) scale(.72);
}
.contract-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.035) 43%, transparent 52%);
}
.house-art { position: relative; display: grid; place-items: center; overflow: hidden; }
.house-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.house-art b { position: absolute; color: #cab894; font-weight: 500; }
.house-art:has(img) b { display: none; }
.house-art.contract {
  width: 142px;
  height: 142px;
  border: 1px solid #765d38;
  transform: rotate(45deg);
  box-shadow: 0 0 0 4px #11100d, 0 0 0 5px #403322, 0 0 34px rgba(var(--house-rgb), .22);
}
.house-art.contract img { transform: rotate(-45deg) scale(1.34); filter: grayscale(.48) sepia(.28) saturate(.82) contrast(1.22) brightness(.8); }
.house-art.contract b { transform: rotate(-45deg); font-size: 25px; }
.house-art.contract.infamous { border-color: #8f4638; }
.class-medallion {
  position: absolute;
  right: 29px;
  bottom: 25px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #705a3d;
  border-radius: 50%;
  color: #c3b08e;
  background: radial-gradient(circle at 35% 30%, #494033, #100e0b 70%);
  box-shadow: 0 3px 10px #000, inset 0 0 9px #000;
  font-size: 11px;
}
.class-medallion.infamous { border-color: #88443b; color: #d69683; }
.contract-name { padding: 15px 13px 12px; text-align: center; border-bottom: 1px solid #362d22; }
.contract-name small { display: block; color: var(--house); text-transform: uppercase; letter-spacing: .24em; font-size: 8px; }
.contract-name h2 { margin: 5px 0 4px; color: #e0d2b9; font-size: 23px; font-weight: 500; line-height: 1.05; }
.contract-name p { margin: 0; color: #817663; font: 9px/1.35 ui-monospace, monospace; overflow-wrap: anywhere; }
.house-name {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: end;
  padding: 11px 13px;
  border-bottom: 1px solid #342a20;
  background: rgba(var(--house-rgb), .045);
}
.house-name span { color: #726756; text-transform: uppercase; letter-spacing: .18em; font-size: 8px; }
.house-name strong { color: var(--house); font-size: 15px; font-weight: 500; }
.house-name small { grid-column: 1 / -1; color: #756c5e; font-size: 9px; }
.contract-change {
  width: 100%;
  min-height: 39px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid #433322;
  background: linear-gradient(90deg, rgba(var(--house-rgb), .1), transparent);
  color: #c8b898;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 9px;
}
.contract-change:hover { background: rgba(var(--house-rgb), .14); }
.contract-change b { color: var(--house); font-size: 22px; font-weight: 400; }
.contract-facts { margin: 0; padding: 4px 13px; }
.contract-facts div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dotted #3a3025; }
.contract-facts dt { color: #746b5d; font-size: 9px; }
.contract-facts dd { margin: 0; color: #b5a88f; font-size: 9px; text-align: right; }
.weapon-permits { padding: 10px 13px 13px; display: flex; flex-wrap: wrap; gap: 4px; }
.weapon-permits > span { width: 100%; margin-bottom: 3px; color: #706655; text-transform: uppercase; letter-spacing: .15em; font-size: 8px; }
.weapon-permits em {
  padding: 3px 5px;
  border-left: 2px solid #55422d;
  background: #11100e;
  color: #958a76;
  font: normal 8px/1.2 ui-monospace, monospace;
}
.source-seal {
  margin: 0 12px 13px;
  padding: 10px 0 0;
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 8px;
  border-top: 1px solid #3b3024;
}
.source-seal > span {
  width: 24px;
  height: 24px;
  border: 1px solid #5e5038;
  transform: rotate(45deg);
  background: radial-gradient(circle, var(--house) 0 2px, transparent 3px), #16130f;
}
.source-seal div { display: grid; gap: 1px; }
.source-seal small { color: #776d5b; text-transform: uppercase; letter-spacing: .1em; font-size: 7px; }
.source-seal strong { color: #bbae96; font-size: 10px; font-weight: 500; }
.source-seal em { color: #655e53; font: normal 7px/1.2 ui-monospace, monospace; }

/* Centre planner */
.planner-panel { min-width: 0; overflow: hidden; }
.planner-title { padding-right: 4px; }
.inventory-tabs { display: flex; align-self: stretch; }
.inventory-tabs button {
  min-width: 112px;
  border: 0;
  border-left: 1px solid #443626;
  background: transparent;
  color: #766c5a;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 8px;
}
.inventory-tabs button:hover { color: #b9aa90; background: rgba(255,255,255,.018); }
.inventory-tabs button.active { color: #e0d1b6; background: linear-gradient(180deg, rgba(var(--house-rgb), .19), rgba(var(--house-rgb), .035)); box-shadow: inset 0 -2px var(--house); }
.inventory-section > header {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #342b21;
  background: #100f0d;
}
.inventory-section > header span { color: #9e8f76; text-transform: uppercase; letter-spacing: .17em; font-size: 8px; }
.inventory-section > header small { color: #665f54; font-size: 8px; }
.inventory-board {
  position: relative;
  height: 360px;
  display: grid;
  grid-template-columns: 1fr 84px 118px 84px 1fr;
  grid-template-rows: 90px 104px 80px 58px;
  gap: 8px;
  padding: 14px 18px;
  overflow: hidden;
  border-bottom: 1px solid #4a3927;
  background:
    linear-gradient(90deg, rgba(0,0,0,.43), transparent 18%, transparent 82%, rgba(0,0,0,.43)),
    radial-gradient(ellipse at 50% 46%, rgba(var(--house-rgb), .09), transparent 34%),
    repeating-linear-gradient(45deg, #121516 0 2px, #0d1011 2px 6px);
}
.inventory-board::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(99,82,56,.35);
  box-shadow: inset 0 0 50px #000;
  pointer-events: none;
}
.inventory-watermark {
  position: absolute;
  z-index: 0;
  inset: 42px 31% 25px;
  display: grid;
  place-items: center;
  opacity: .16;
  pointer-events: none;
}
.inventory-watermark .house-art { width: 185px; height: 185px; filter: grayscale(1) sepia(.4); }
.inventory-watermark > span { margin-top: -24px; color: var(--house); text-transform: uppercase; letter-spacing: .45em; font-size: 10px; }
.house-art.watermark img { object-fit: contain; }
.equipment-slot {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  border: 1px solid #3f4b52;
  border-radius: 0;
  background:
    linear-gradient(145deg, rgba(31,42,48,.9), rgba(8,11,12,.98) 68%),
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(255,255,255,.02) 5px 6px);
  box-shadow: inset 0 0 18px #000, 0 1px 0 rgba(255,255,255,.025);
  cursor: pointer;
}
.equipment-slot:hover { border-color: #7a765f; filter: brightness(1.08); }
.equipment-slot.filled { border-color: #7d6337; background: linear-gradient(145deg, rgba(61,45,24,.88), rgba(10,9,8,.98) 68%); }
.slot-corners::before,
.slot-corners::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-color: #68747b;
  border-style: solid;
  opacity: .7;
}
.slot-corners::before { left: 3px; top: 3px; border-width: 1px 0 0 1px; }
.slot-corners::after { right: 3px; bottom: 3px; border-width: 0 1px 1px 0; }
.slot-glyph {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid #3d4950;
  color: #617078;
  background: #0c1011;
  transform: rotate(45deg);
  font-size: 8px;
}
.slot-glyph::first-line { transform: rotate(-45deg); }
.slot-copy { max-width: 100%; display: grid; gap: 2px; text-align: center; }
.slot-copy strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b7b0a1; font-size: 9px; font-weight: 500; }
.slot-copy small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6f7b80; font: 7px/1.2 ui-monospace, monospace; }
.equipment-slot.filled .slot-copy strong { color: #d4bd87; }
.slot-main_hand { grid-column: 1; grid-row: 1 / span 3; }
.slot-off_hand { grid-column: 5; grid-row: 1 / span 3; }
.slot-helmet { grid-column: 3; grid-row: 1; }
.slot-amulet { grid-column: 4; grid-row: 1; }
.slot-body_armour { grid-column: 3; grid-row: 2 / span 2; }
.slot-ring_left { grid-column: 2; grid-row: 2; }
.slot-ring_right { grid-column: 4; grid-row: 2; }
.slot-gloves { grid-column: 2; grid-row: 3; }
.slot-boots { grid-column: 4; grid-row: 3; }
.slot-belt { grid-column: 3; grid-row: 4; }
.game-icon.item { width: 38px; height: 38px; }

/* Five fixed skill rails */
.skills-board { background: #0c0b09; }
.skill-rail-heading {
  min-height: 58px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #493824;
  background:
    linear-gradient(90deg, rgba(var(--house-rgb), .11), transparent 36%),
    linear-gradient(#201a13, #100e0b);
}
.skill-rail-heading div { display: grid; gap: 2px; }
.skill-rail-heading span { color: var(--house); text-transform: uppercase; letter-spacing: .2em; font-size: 8px; }
.skill-rail-heading strong { color: #c9b99c; font-size: 14px; font-weight: 500; }
.skill-rail-heading small { max-width: 390px; color: #6f675a; text-align: right; font-size: 8px; line-height: 1.4; }
.skill-row {
  position: relative;
  min-height: 89px;
  display: grid;
  grid-template-columns: 47px minmax(250px, .9fr) minmax(300px, 1.2fr);
  align-items: stretch;
  border-bottom: 1px solid #30271d;
  background:
    linear-gradient(90deg, rgba(255,255,255,.012), transparent 32%),
    #0d0c0a;
  cursor: pointer;
}
.skill-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
}
.skill-row:hover { background: #11100d; }
.skill-row.focused { background: linear-gradient(90deg, rgba(var(--house-rgb), .14), rgba(var(--house-rgb), .025) 55%, transparent); }
.skill-row.focused::before { background: var(--house); box-shadow: 0 0 10px rgba(var(--house-rgb), .45); }
.skill-order {
  display: grid;
  place-items: center;
  align-content: center;
  border-right: 1px solid #34291e;
  background: rgba(0,0,0,.22);
}
.skill-order span { color: #635a4b; text-transform: uppercase; letter-spacing: .1em; font-size: 6px; }
.skill-order strong { color: #8a7c65; font-size: 16px; font-weight: 400; }
.skill-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-right: 1px solid #342a20;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.skill-choice:hover { background: rgba(255,255,255,.018); }
.game-icon {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #6e5a3a;
  background: radial-gradient(circle at 32% 27%, #54462f, #11100d 72%);
  box-shadow: 0 2px 7px #000, inset 0 0 8px #000;
}
.game-icon::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(224,198,143,.16);
  pointer-events: none;
}
.game-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-icon b { position: absolute; color: #c7b797; font-size: 10px; font-weight: 500; }
.game-icon:has(img) b { display: none; }
.game-icon.support { border-color: #74603f; border-radius: 50%; background: radial-gradient(circle, #302a20, #0b0a08 72%); }
.game-icon.support::after { border-radius: 50%; }
.game-icon.item { border-color: #4c5960; background: #101416; }
.skill-choice-copy { min-width: 0; display: grid; gap: 3px; }
.skill-source { color: #746955; text-transform: uppercase; letter-spacing: .13em; font-size: 7px; }
.skill-choice-copy > strong { color: #ddcfb4; font-size: 14px; font-weight: 500; }
.skill-choice-copy > small { color: #776f62; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 8px; }
.support-workbench {
  min-width: 0;
  display: grid;
  grid-template-columns: 116px minmax(160px,1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
}
.support-config { min-width: 0; display: grid; gap: 5px; }
.support-config label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #827765; text-transform: uppercase; letter-spacing: .08em; font-size: 7px; }
.support-config select {
  width: 42px;
  height: 27px;
  padding: 2px 5px;
  border: 1px solid #5d4a30;
  border-radius: 0;
  color: #d8c8aa;
  background: #0b0a08;
  cursor: pointer;
}
.support-config select:disabled { opacity: .34; cursor: not-allowed; }
.support-config small { color: #625b50; font: 7px/1.25 ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support-links {
  min-height: 53px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 4px;
  overflow-x: auto;
}
.support-links.empty { border-left: 1px dotted #342c22; }
.socket-link { position: relative; display: flex; align-items: center; }
.socket-link + .socket-link::before {
  content: "";
  width: 13px;
  height: 4px;
  margin: 0 -1px;
  border-top: 1px solid #826638;
  border-bottom: 1px solid #332516;
  background: #4b351c;
  box-shadow: 0 1px #090705;
}
.support-socket {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 3px;
  display: grid;
  place-items: center;
  border: 2px solid #57472f;
  border-radius: 50%;
  background: radial-gradient(circle, #17140f 0 45%, #090807 47% 100%);
  box-shadow: 0 2px 6px #000, inset 0 0 8px #000, 0 0 0 1px #19130d;
  color: #7f6d51;
  cursor: pointer;
}
.support-socket:hover { border-color: #a3824a; }
.support-socket.filled { border-color: #8c7148; }
.support-socket .game-icon { width: 34px; height: 34px; border-width: 0; box-shadow: none; }
.no-links { margin-left: 9px; color: #544e45; text-transform: uppercase; letter-spacing: .13em; font-size: 7px; }

/* Ledger */
.results-panel { position: sticky; top: 12px; overflow: hidden; }
.ledger-empty { min-height: 360px; display: grid; align-content: center; justify-items: center; padding: 26px; text-align: center; background: radial-gradient(circle at 50% 38%, rgba(var(--house-rgb), .07), transparent 14rem); }
.ledger-empty::before { content: "◇"; color: #55432c; font-size: 58px; line-height: 1; }
.ledger-empty span { color: var(--house); text-transform: uppercase; letter-spacing: .2em; font-size: 8px; }
.ledger-empty strong { margin-top: 6px; color: #c9b99c; font-size: 18px; font-weight: 500; }
.ledger-empty p { color: #71695d; font-size: 9px; line-height: 1.55; }
.focused-skill {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr);
  gap: 11px;
  align-items: center;
  padding: 14px 13px;
  border-bottom: 1px solid #3c3023;
  background: linear-gradient(100deg, rgba(var(--house-rgb), .13), transparent 66%);
}
.focused-skill .game-icon { width: 54px; height: 54px; }
.focused-skill div { min-width: 0; display: grid; gap: 3px; }
.focused-skill span { color: #776b58; text-transform: uppercase; letter-spacing: .12em; font-size: 7px; }
.focused-skill strong { color: #e0d0b4; font-size: 16px; font-weight: 500; }
.focused-skill small { color: #6e6659; font: 7px/1.3 ui-monospace, monospace; }
.damage-tags { min-height: 33px; padding: 6px 12px; display: flex; align-items: center; gap: 5px; border-bottom: 1px solid #30271f; }
.damage-tags span { padding: 3px 6px; border-left: 2px solid #5d5141; background: #11100e; color: #8f8779; font: 7px/1 ui-monospace, monospace; text-transform: uppercase; }
.damage-tags .physical { border-color: #a49d8d; color: #c4bdad; }
.damage-tags .fire { border-color: #a84d34; color: #d68767; }
.damage-tags .cold { border-color: #527ca2; color: #83acd0; }
.damage-tags .lightning { border-color: #9a833d; color: #d8bd62; }
.damage-tags .chaos { border-color: #72548b; color: #a886c4; }
.metric-ledger { margin: 0; padding: 5px 12px; }
.metric-ledger div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dotted #3a3025; }
.metric-ledger dt { color: #756d60; font-size: 9px; }
.metric-ledger dd { margin: 0; color: #d6c7aa; font: 13px/1 ui-monospace, monospace; }
.ledger-section { padding: 10px 12px 12px; border-top: 1px solid #3c3023; }
.ledger-section h3 { margin: 0 0 9px; color: var(--house); text-transform: uppercase; letter-spacing: .15em; font-size: 8px; font-weight: 500; }
.ledger-note { color: #6c6458; font-size: 8px; }
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-bottom: 8px; background: #30271e; }
.source-grid span { padding: 7px; display: grid; gap: 3px; background: #100f0d; color: #72695b; font-size: 7px; }
.source-grid strong { color: #c8b998; font: 12px ui-monospace, monospace; }
.support-detail-list { display: grid; }
.support-detail-list > div { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 8px; padding: 7px 0; border-bottom: 1px dotted #342b21; }
.support-detail-list .game-icon { width: 31px; height: 31px; }
.support-detail-list > div > span { min-width: 0; display: grid; gap: 2px; }
.support-detail-list strong { color: #cabb9f; font-size: 9px; font-weight: 500; }
.support-detail-list em { color: #897859; font: normal 7px/1.2 ui-monospace, monospace; }
.support-detail-list small { color: #675f53; font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-line { display: grid; grid-template-columns: 8px 1fr; gap: 7px; align-items: center; padding: 4px 0; color: #756d61; font-size: 8px; }
.status-line > span { width: 6px; height: 6px; transform: rotate(45deg); background: #4d4437; }
.status-line.active > span { background: #768561; box-shadow: 0 0 5px rgba(118,133,97,.35); }
.status-line.staged > span { background: #8d693d; }
.data-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 8px 12px 12px; background: #352a1f; }
.data-summary span { padding: 6px; display: flex; justify-content: space-between; background: #100f0d; color: #645d52; font-size: 7px; }
.data-summary b { color: #a89a81; font-weight: 500; }

/* Source record */
.stats-board { min-height: 760px; padding: 16px; }
.record-heading { padding: 14px; border: 1px solid #493a28; background: rgba(var(--house-rgb), .055); display: grid; gap: 5px; }
.record-heading span { color: var(--house); text-transform: uppercase; letter-spacing: .16em; font-size: 8px; }
.record-heading strong { color: #cbbb9f; font: 11px/1.35 ui-monospace, monospace; overflow-wrap: anywhere; }
.record-table { margin: 12px 0 0; border-top: 1px solid #3d3022; }
.record-table div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 9px 4px; border-bottom: 1px dotted #392f25; }
.record-table dt { color: #756b5a; font-size: 9px; }
.record-table dd { margin: 0; color: #bbae96; font: 9px ui-monospace, monospace; }
.record-section { margin-top: 16px; padding-top: 13px; border-top: 1px solid #443525; }
.record-section h3 { color: var(--house); text-transform: uppercase; letter-spacing: .16em; font-size: 9px; font-weight: 500; }
.record-section ul { margin: 8px 0; padding-left: 18px; color: #827867; font-size: 9px; line-height: 1.6; }
.flag-cloud { display: flex; flex-wrap: wrap; gap: 4px; }
.flag-cloud span { padding: 4px 6px; border-left: 2px solid #58452f; background: #11100e; color: #887e6c; font: 7px ui-monospace, monospace; }

/* Pickers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3,3,2,.88);
  backdrop-filter: blur(3px);
}
.picker-modal {
  width: min(720px, 96vw);
  max-height: min(840px, 94vh);
  display: grid;
  grid-template-rows: auto auto auto minmax(0,1fr);
  overflow: hidden;
  background: #0e0c09;
}
.picker-modal.wide { width: min(1100px, 96vw); }
.picker-crown {
  min-height: 68px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #5b452e;
  background: linear-gradient(90deg, rgba(var(--house-rgb), .14), transparent 45%), linear-gradient(#2c241a, #14110d);
}
.picker-crown div { display: grid; gap: 4px; }
.picker-crown span { color: var(--house); text-transform: uppercase; letter-spacing: .19em; font-size: 8px; }
.picker-crown h3 { margin: 0; color: #dfcfb2; font-size: 21px; font-weight: 500; }
.picker-crown button {
  width: 36px;
  height: 36px;
  border: 1px solid #5c4931;
  border-radius: 0;
  background: #14110d;
  color: #9d8d73;
  cursor: pointer;
  font-size: 23px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 1px; padding: 8px 10px; border-bottom: 1px solid #34291e; background: #0b0a08; }
.filter-chip {
  padding: 7px 11px;
  border: 0;
  border-left: 1px solid #4a3927;
  border-radius: 0;
  background: #12100d;
  color: #776e60;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 7px;
}
.filter-chip:hover, .filter-chip.active { color: #d2c2a5; background: rgba(var(--house-rgb), .12); border-left-color: var(--house); }
.search-plate {
  min-height: 45px;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid #3b2f22;
  background: #11100d;
}
.search-plate > span { color: #6f6658; text-transform: uppercase; letter-spacing: .15em; font-size: 7px; }
.search-input {
  width: 100%;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #4d3e2c;
  border-radius: 0;
  color: #d4c5a9;
  background: #090806;
  font: 10px ui-monospace, monospace;
}
.search-input::placeholder { color: #514b42; }
.picker-list { min-height: 0; overflow: auto; padding: 8px; scrollbar-color: #5a452d #0b0a08; }
.mercenary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.mercenary-choice {
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: 58px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #342a20;
  border-radius: 0;
  background: linear-gradient(90deg, #15130f, #0d0c0a);
  text-align: left;
  cursor: pointer;
}
.mercenary-choice:hover { border-color: #6c5538; background: rgba(var(--house-rgb), .07); }
.mercenary-choice.selected { border-color: var(--house); box-shadow: inset 3px 0 var(--house); }
.house-art.roster { width: 54px; height: 54px; border: 1px solid #5b4931; background: #0b0a08; }
.house-art.roster img { object-fit: cover; filter: saturate(.7); }
.house-art.roster b { font-size: 11px; }
.mercenary-choice > span:not(.house-art) { min-width: 0; display: grid; gap: 3px; }
.mercenary-choice strong { color: #cfbfa2; font-size: 12px; font-weight: 500; }
.mercenary-choice small { color: #746b5c; font-size: 8px; }
.mercenary-choice em { color: #625b50; font: normal 7px/1.25 ui-monospace, monospace; }
.mercenary-choice > b, .mercenary-choice > i { align-self: start; padding: 3px 5px; border-left: 2px solid #5a4330; color: #856b53; font: normal 7px ui-monospace, monospace; text-transform: uppercase; }
.mercenary-choice > b { border-color: #8f4336; color: #bd7564; }
.choice-group { margin-bottom: 9px; border: 1px solid #352a20; }
.choice-group h4 {
  min-height: 31px;
  margin: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #17140f;
  border-bottom: 1px solid #3d3022;
  color: var(--house);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 8px;
  font-weight: 500;
}
.choice-group h4 span { color: #6e6557; font: 8px ui-monospace, monospace; }
.picker-choice {
  width: 100%;
  min-height: 60px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid #2f271e;
  border-radius: 0;
  background: #0d0c0a;
  text-align: left;
  cursor: pointer;
}
.picker-choice:hover { background: rgba(var(--house-rgb), .075); }
.picker-choice .game-icon { width: 44px; height: 44px; }
.picker-choice > span { min-width: 0; display: grid; gap: 2px; }
.picker-choice strong { color: #c9baa0; font-size: 11px; font-weight: 500; }
.picker-choice small { color: #71695d; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-choice em { color: #8a7755; font: normal 7px/1.2 ui-monospace, monospace; }
.picker-choice.remove { min-height: 34px; display: block; border-left: 2px solid #703a31; color: #a66d60; text-transform: uppercase; letter-spacing: .11em; font-size: 8px; }
.empty-message { padding: 20px; color: #736b5e; text-align: center; font-size: 9px; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 9px 16px;
  border: 1px solid #6a5235;
  background: #17120d;
  color: #d2c1a1;
  box-shadow: 0 8px 25px #000;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 8px;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: 1fr minmax(300px, auto) 1fr;
  align-items: center;
  gap: 16px;
  color: #5d574e;
  text-align: center;
  font-size: 8px;
  line-height: 1.45;
}
footer p { margin: 0; }
footer strong { color: #817663; font-weight: 500; }
.footer-rule { height: 1px; background: linear-gradient(90deg, transparent, #403225); }
.footer-rule:last-child { transform: scaleX(-1); }

.loading-screen, .load-failure {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 11px;
  color: #7b705e;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 9px;
}
.loader-mark, .load-failure strong {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 1px solid #6b5437;
  transform: rotate(45deg);
  color: #b99962;
  font-size: 18px;
}
.loader-mark::first-line, .load-failure strong::first-line { transform: rotate(-45deg); }

@media (max-width: 1350px) {
  .planner-layout { grid-template-columns: 225px minmax(650px, 1fr); }
  .results-panel { grid-column: 1 / -1; position: relative; top: auto; display: grid; grid-template-columns: minmax(260px,.7fr) minmax(420px,1.3fr); }
  .results-panel > .frame-title, .results-panel > .data-summary { grid-column: 1 / -1; }
  .focused-skill, .ledger-empty { grid-column: 1; }
  .damage-tags, .metric-ledger { grid-column: 1; }
  .ledger-section { grid-column: 2; border-left: 1px solid #3c3023; }
}

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto 1fr; }
  .header-rule { display: none; }
  .wordmark { text-align: left; min-width: 0; }
  .wordmark h1 { font-size: 29px; }
  .header-actions { grid-column: 3; }
  .planner-layout { width: min(760px, calc(100% - 20px)); grid-template-columns: 1fr; }
  .contract-panel, .results-panel { position: relative; top: auto; }
  .contract-panel { display: grid; grid-template-columns: 190px 1fr; }
  .contract-panel .frame-title { grid-column: 1 / -1; }
  .contract-art { grid-row: 2 / span 4; min-height: 250px; border-right: 1px solid #3b3023; }
  .contract-name, .house-name, .contract-change { grid-column: 2; }
  .contract-facts, .weapon-permits, .source-seal { grid-column: 1 / -1; }
  .results-panel { display: block; }
  .ledger-section { border-left: 0; }
}

@media (max-width: 760px) {
  .site-header { min-height: 112px; grid-template-columns: 1fr; gap: 8px; padding: 10px 13px; }
  .wordmark { text-align: center; }
  .header-actions { grid-column: 1; justify-content: center; flex-wrap: wrap; }
  .planner-layout { width: calc(100% - 12px); margin-top: 8px; }
  .contract-panel { display: block; }
  .contract-art { min-height: 170px; border-right: 0; }
  .house-art.contract { width: 108px; height: 108px; }
  .inventory-board { height: 330px; grid-template-columns: 1fr 65px 92px 65px 1fr; padding: 12px 9px; gap: 6px; }
  .inventory-watermark { left: 28%; right: 28%; }
  .skill-row { grid-template-columns: 38px minmax(0,1fr); }
  .skill-choice { border-right: 0; }
  .support-workbench { grid-column: 1 / -1; grid-template-columns: 105px minmax(0,1fr); border-top: 1px solid #2e261d; padding-left: 47px; }
  .skill-rail-heading { align-items: flex-start; }
  .skill-rail-heading small { max-width: 48%; }
  .mercenary-grid { grid-template-columns: 1fr; }
  .picker-modal { max-height: 96vh; }
  footer { grid-template-columns: 1fr; }
  .footer-rule { display: none; }
}

@media (max-width: 510px) {
  .patch-badge { width: 100%; text-align: center; border: 0; }
  .frame-title.planner-title { min-height: 70px; display: grid; }
  .inventory-tabs { width: 100%; }
  .inventory-tabs button { min-width: 0; flex: 1; min-height: 31px; border-top: 1px solid #443626; }
  .inventory-board { height: 300px; grid-template-columns: 1fr 54px 78px 54px 1fr; grid-template-rows: 73px 87px 65px 49px; gap: 4px; }
  .slot-copy strong { font-size: 7px; }
  .slot-copy small { display: none; }
  .skill-choice { grid-template-columns: 48px minmax(0,1fr); padding: 7px; }
  .skill-choice .game-icon { width: 43px; height: 43px; }
  .skill-choice-copy > small { display: none; }
  .support-workbench { padding-left: 39px; grid-template-columns: 92px minmax(0,1fr); }
  .support-socket { width: 39px; height: 39px; flex-basis: 39px; }
  .support-socket .game-icon { width: 30px; height: 30px; }
  .socket-link + .socket-link::before { width: 7px; }
  .skill-rail-heading { display: grid; }
  .skill-rail-heading small { max-width: none; text-align: left; }
  .record-table div { grid-template-columns: 1fr; gap: 4px; }
}
