.market-shell {
  --market-gold: #e7c979;
  --market-mint: #77d7ad;
  --market-ink: #06140f;
  min-height: calc(100vh - 7rem);
  padding: clamp(1rem, 2vw, 2rem);
  color: #e8eadf;
  background:
    linear-gradient(90deg, rgba(3, 17, 12, .97) 0%, rgba(5, 25, 17, .82) 43%, rgba(6, 20, 15, .28) 76%, rgba(4, 14, 10, .48) 100%),
    linear-gradient(0deg, rgba(2, 13, 9, .78), rgba(2, 13, 9, .12) 68%),
    url("art/market-stall.2b40c1bbe97a.webp") 70% top / cover fixed;
}

.tier-0 { --tier-color: #aeb5b0; }
.tier-1 { --tier-color: #65cf82; }
.tier-2 { --tier-color: #5daaf2; }
.tier-3 { --tier-color: #bd72e6; }
.tier-4 { --tier-color: #ef9a43; }

.director-back {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  margin-bottom: 1.5rem !important;
  padding: .58rem .9rem;
  color: #f0d58b !important;
  border: 1px solid rgba(231, 201, 121, .62);
  background: rgba(12, 36, 25, .88);
  box-shadow: inset 3px 0 #77d7ad, 0 .3rem 1rem rgba(0, 0, 0, .22);
  font-size: .82rem !important;
  font-weight: 650;
  letter-spacing: .025em;
  text-decoration: none;
}
.director-back:hover {
  color: #fff0bd !important;
  border-color: #e7c979;
  background: rgba(24, 61, 42, .96);
  transform: translateY(-1px);
}

.market-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  max-width: 1540px;
  margin: 0 auto 1.25rem;
  padding: clamp(1.2rem, 3vw, 2.4rem);
  border: 1px solid rgba(231, 201, 121, .38);
  border-top: 3px solid var(--market-gold);
  background: linear-gradient(105deg, rgba(5, 24, 17, .97) 0%, rgba(12, 42, 29, .72) 52%, rgba(6, 25, 17, .32) 100%);
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, .35);
}

.market-hero h1,
.goods-strip h2,
.market-inventory h2,
.catalog-heading h2 {
  margin: .15rem 0;
  color: #f1dda3;
  font-family: Georgia, serif;
  font-weight: 500;
}

.market-hero h1 { font-size: clamp(2.1rem, 5vw, 4.5rem); line-height: .95; }
.market-hero p { max-width: 52rem; margin-bottom: 0; color: #c9d1c8; }
.market-hero .back { display: inline-block; margin-bottom: 1.5rem; color: #c9d1c8; }

.purse {
  min-width: 12rem;
  padding: 1.1rem 1.4rem;
  text-align: center;
  border: 1px solid rgba(231, 201, 121, .65);
  background: rgba(2, 16, 10, .86);
}
.purse small, .purse span { display: block; text-transform: uppercase; letter-spacing: .12em; }
.purse strong { display: block; color: var(--market-gold); font: 3.1rem/1 Georgia, serif; }
.purse p { margin: .65rem 0 0; font-size: .78rem; }

.market-alert,
.budget-form,
.goods-strip,
.market-layout {
  max-width: 1540px;
  margin-right: auto;
  margin-left: auto;
}
.market-alert { margin-bottom: 1rem; padding: 1rem; border-left: 4px solid #df6b64; background: #361616; }
.budget-form { display: flex; justify-content: flex-end; gap: .7rem; align-items: end; margin-bottom: 1rem; }
.budget-form label { max-width: 18rem; }

.goods-strip {
  display: grid;
  grid-template-columns: minmax(14rem, .7fr) 2fr;
  gap: 1rem 2rem;
  margin-bottom: 1.25rem;
  padding: 1.2rem 1.4rem;
  border-left: 4px solid var(--market-gold);
  background: rgba(7, 34, 23, .91);
}
.goods-strip h2, .market-inventory h2, .catalog-heading h2 { font-size: 1.65rem; }
.goods-strip p { margin: .35rem 0 0; color: #bac8bb; }
.good-tokens { display: flex; gap: .6rem; overflow-x: auto; padding: .15rem 0 .4rem; }
.good-token {
  flex: 0 0 9.5rem;
  padding: .75rem;
  color: #e7eadf;
  border: 1px solid var(--tier-color, #466e59);
  background: rgba(5, 22, 15, .9);
  text-decoration: none;
}
.good-token small, .good-token strong { display: block; }
.good-token small { margin-bottom: .25rem; color: var(--tier-color, #80c8a8); text-transform: uppercase; letter-spacing: .08em; }
.good-token.selected { border-color: #f0d27d; box-shadow: inset 0 -3px #f0d27d; background: #173b28; }
.selected-good { grid-column: 1 / -1; padding-top: .7rem; border-top: 1px solid rgba(119, 215, 173, .25); }
.goods-empty { align-self: center; color: #9eaa9f; }

.market-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.market-inventory,
.market-stall {
  border: 1px solid rgba(122, 169, 139, .3);
  background: rgba(3, 19, 13, .91);
}
.market-inventory { position: sticky; top: 1rem; padding: 1.2rem; max-height: calc(100vh - 2rem); overflow: auto; }
.inventory-title { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid rgba(231, 201, 121, .28); }
.inventory-title form { margin: 0; }
.undo-market { padding: .5rem .7rem; font-size: .8rem; }
.undo-market-form { display: grid; justify-items: end; gap: .25rem; max-width: 15rem; }
.undo-market-form small { color: #9faf9f; font-size: .68rem; line-height: 1.25; text-align: right; }
.load-meter, .mount-meter { display: flex; justify-content: space-between; gap: .7rem; align-items: center; margin-top: .75rem; padding: .65rem .75rem; border: 1px solid rgba(119,215,173,.32); background: rgba(8,35,24,.72); }
.load-meter div { display: grid; }
.load-meter small, .mount-meter small, .closing-advisor>small { color: #83cba8; font-size: .62rem; letter-spacing: .12em; }
.load-meter strong, .mount-meter b { color: #e9d392; }
.load-meter span, .mount-meter span { color: #aebdb1; font-size: .72rem; }
.load-meter.is-overloaded { border-color: #df6b64; background: rgba(65,20,18,.72); }
.load-meter.is-overloaded small, .load-meter.is-overloaded strong, .load-meter.is-overloaded span { color: #f0aaa3; }
.mount-meter { display: grid; grid-template-columns: 1fr auto; }
.mount-meter small { grid-column: 1 / -1; }
.inventory-location { margin: .75rem 0 .25rem; color: #8fd2b0; font: .7rem/1.2 Segoe UI, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.inventory-list { display: grid; gap: .65rem; margin: .8rem 0; }
.inventory-entry { padding: .8rem; border-left: 3px solid var(--tier-color, #52866d); background: rgba(20, 54, 38, .48); box-shadow: inset .2rem 0 .8rem color-mix(in srgb, var(--tier-color, #52866d) 10%, transparent); }
.inventory-entry > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
.inventory-entry strong { color: #f2dfaa; }
.inventory-entry small { color: #a7b7aa; }
.inventory-entry i { margin-left: auto; color: var(--tier-color, #a7b7aa); font-size: .67rem; font-style: normal; letter-spacing: .1em; text-transform: uppercase; }
.inventory-entry p { margin: .45rem 0; color: #b9d6c2; font-size: .82rem; }
.inventory-entry details { padding: .35rem 0; color: #d4b3f0; }
.inventory-entry details p { color: #cfc5d8; }
.inventory-entry form { margin: .55rem 0 0; }
.improvement-ledger b { color: #8ee0ba; }
.inventory-ledger { display: grid!important; gap: .25rem; margin: .55rem 0; }
.inventory-ledger span { padding: .3rem .45rem; color: #bfcac1; border-left: 2px solid #77867b; background: rgba(0,0,0,.18); font-size: .7rem; }
.inventory-ledger span.magic { border-color: #bc6fe1; }
.inventory-ledger span.quality { border-color: #e7c979; }
.inventory-ledger span.physical { border-color: #5daaf2; }
.inventory-ledger b { color: var(--tier-color, #8ee0ba); }
.quality-current {
  display: grid;
  gap: .18rem;
  margin: .55rem 0;
  padding: .6rem .7rem;
  border-left: 2px solid var(--market-gold);
  background: rgba(5, 22, 15, .7);
}
.quality-current strong { color: #f0d27d; }
.quality-current span { color: #d4dbd1; font-size: .82rem; }
.quality-current small { color: #9dab9f; }
.quality-picker { border-top: 1px solid rgba(231, 201, 121, .2); }
.quality-picker summary { cursor: pointer; color: #e8d497; }
.quality-picker form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: end; }
.quality-picker label { margin: 0; color: #9eafa2; font-size: .72rem; }
.quality-picker select { width: 100%; margin-top: .2rem; }
.quality-picker button { padding: .55rem .65rem; white-space: nowrap; }
.quality-guide { margin-top: .55rem; padding: .35rem .55rem; background: rgba(0, 0, 0, .18); }
.quality-guide p { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .5rem; margin: .3rem 0; }
.quality-guide b { color: #e4d7ac; }
.quality-none { padding-left: .55rem; border-left: 2px solid #74877a; color: #9caaa0 !important; }
.reference-value { color: #9dab9f !important; }
.reference-value b { color: #d8c98f; }
.magic-button { color: #e1bcff; border-color: #8f50b6; background: #24132e; }
.inventory-actions { display: grid; gap: .6rem; padding-top: .8rem; border-top: 1px solid rgba(231, 201, 121, .28); }
.closing-advisor { margin: .8rem 0; padding: .8rem; border-left: 3px solid #e7c979; background: rgba(42,34,12,.55); }
.closing-advisor ul { margin: .4rem 0 0; padding-left: 1.1rem; color: #e4d9bd; font-size: .78rem; }
.closing-advisor li+li { margin-top: .3rem; }
.inventory-actions .button { text-align: center; }
.inventory-empty { min-height: 8rem; color: #87978b; }

.market-stall { min-width: 0; }
.market-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1rem; border-bottom: 1px solid rgba(122, 169, 139, .3); }
.market-toolbar nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.market-toolbar nav a { padding: .5rem .7rem; color: #bec9c0; border: 1px solid transparent; text-decoration: none; }
.market-toolbar nav a:hover, .market-toolbar nav a.active { color: #07160f; background: var(--market-gold); }
.market-search { min-width: min(20rem, 100%); margin: 0; }
.market-search span { display: block; margin-bottom: .25rem; color: #9eafa2; font-size: .78rem; }
.market-search input { width: 100%; }
.catalog-heading { display: flex; justify-content: space-between; align-items: end; padding: 1.25rem 1.25rem .4rem; }
.catalog-heading > span { color: #8ea294; }
.catalog-families { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem 1.1rem; }
.catalog-families a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .35rem .65rem; border: 1px solid rgba(231, 201, 121, .35); color: #e8dda9; font-size: .8rem; text-decoration: none; }
.catalog-families a:hover, .catalog-families a:focus-visible { background: #e7c979; color: #07160f; }
.market-grid { display: grid; gap: .75rem; padding: .8rem 1.1rem 1.25rem; }
.market-group { min-width: 0; scroll-margin-top: 5rem; border: 1px solid color-mix(in srgb, var(--tier-color, #538066) 36%, transparent); background: rgba(3, 24, 17, .45); }
.market-group:not(:has(.market-card:not([hidden]))) { display: none; }
.market-group-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; padding: .55rem .72rem; border-bottom: 1px solid rgba(122, 169, 139, .3); color: #dfeddc; }
.market-group-heading h3 { margin: 0; color: #f3de96; font: 1rem/1.2 Georgia, serif; }
.market-group-heading span { color: #a6b8ac; font-size: .78rem; letter-spacing: .08em; }
.market-group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); gap: .5rem; padding: .5rem; background: linear-gradient(90deg, rgba(4, 18, 13, .55), rgba(3, 30, 18, .15)); }
.market-group:has(:focus-within) { border-color: rgba(231, 201, 121, .65); box-shadow: 0 0 0 1px rgba(231, 201, 121, .22); }
.market-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; gap: .6rem; min-width: 0; padding: .7rem; border: 1px solid color-mix(in srgb, var(--tier-color, #538066) 60%, transparent); border-left: 3px solid var(--tier-color, #538066); background: linear-gradient(120deg, rgba(13, 43, 29, .78), rgba(5, 24, 16, .82)); }
.market-card:hover { border-color: rgba(231, 201, 121, .65); }
.item-main h3, .item-main h4 { margin: .15rem 0 0; color: #e8dda9; font: 1.1rem/1.2 Georgia, serif; }
.item-main { min-width: 0; overflow-wrap: anywhere; }
.item-main p { margin: .35rem 0; color: #b7c3b9; font-size: .84rem; }
.item-main small { color: #81988a; }
.item-main .tier-label { color: var(--tier-color, #aeb5b0); letter-spacing: .11em; text-transform: uppercase; }
.item-buy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6.25rem, auto); align-items: center; gap: .4rem; padding-top: .5rem; border-top: 1px solid rgba(119, 175, 142, .22); }
.item-buy > strong { color: var(--market-gold); font: 1.2rem Georgia, serif; overflow-wrap: anywhere; }
.item-buy > .good-action { grid-column: 1 / -1; }
.item-buy > strong small { display: block; color: #9ca99e; font: .64rem sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.item-buy form, .item-buy button { width: 100%; margin: 0; }
.item-buy button { min-height: 2.75rem; padding: .45rem .35rem; }
.good-action button { color: #08170f; border-color: #8ce0b9; background: #7ad7ad; }
.locked-access { padding: .5rem .3rem; color: var(--tier-color); border: 1px solid color-mix(in srgb, var(--tier-color) 55%, transparent); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.search-empty { padding: 2rem; text-align: center; color: #96a59a; }

.tools-shell,
.forge-shell { min-height: calc(100vh - 4rem); }
.forge-shell {
  background:
    linear-gradient(90deg, rgba(3, 12, 11, .98) 0%, rgba(7, 20, 18, .88) 44%, rgba(19, 11, 28, .42) 76%, rgba(5, 10, 10, .58) 100%),
    linear-gradient(0deg, rgba(2, 10, 8, .82), rgba(8, 4, 13, .08) 68%),
    url("art/magic-forge.88e35d791346.webp") 70% top / cover fixed;
}
.tools-hero,
.forge-heading,
.tool-grid,
.forge-layout { width: min(1180px, 100%); margin-right: auto; margin-left: auto; }
.tools-hero,
.forge-heading {
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border-top: 3px solid var(--market-gold);
  background: linear-gradient(105deg, rgba(4, 22, 15, .98), rgba(8, 35, 23, .62));
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, .3);
}
.tools-hero h1,
.forge-heading h1,
.tool-card h2,
.forged-result h2 {
  margin: .25rem 0;
  color: #f1dda3;
  font-family: Georgia, serif;
  font-weight: 500;
}
.tools-hero h1,
.forge-heading h1 { font-size: clamp(2.2rem, 6vw, 4.8rem); line-height: .95; }
.tools-hero > p:last-child,
.forge-heading > p:last-child { max-width: 44rem; color: #c5d0c7; }
.tools-hero .back,
.forge-heading .back { display: inline-block; margin-bottom: 2rem; color: #c5d0c7; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.tool-card {
  position: relative;
  min-height: 14rem;
  padding: 1.5rem 1.5rem 1.35rem 5.6rem;
  color: #e5e9e2;
  border: 1px solid rgba(119, 175, 142, .38);
  background: linear-gradient(120deg, rgba(6, 29, 19, .96), rgba(18, 55, 38, .78));
  text-decoration: none;
  overflow: hidden;
}
.tool-card::after { content: ''; position: absolute; inset: auto 0 0; height: 3px; background: #456b55; }
.tool-card.active::after { background: linear-gradient(90deg, var(--market-gold), #8b58ad); }
.tool-card:hover { border-color: rgba(231, 201, 121, .72); transform: translateY(-2px); }
.tool-card.pending { opacity: .78; }
.tool-card small { color: #83c9aa; letter-spacing: .12em; }
.tool-card h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
.tool-card p { max-width: 31rem; color: #b9c5bc; }
.tool-card > strong { color: #e7c979; }
.tool-emblem {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: grid;
  width: 2.9rem;
  height: 2.9rem;
  place-items: center;
  color: #07170f;
  background: var(--market-gold);
  transform: rotate(45deg);
}
.tool-emblem::first-letter { transform: rotate(-45deg); }

.forge-layout { display: grid; grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.forge-controls,
.forged-result { border: 1px solid rgba(119, 175, 142, .4); background: rgba(3, 20, 13, .95); }
.forge-controls { display: grid; gap: 1rem; padding: 1.4rem; }
.forge-controls label { margin: 0; }
.forge-controls select { width: 100%; margin-top: .3rem; }
.forge-controls fieldset { margin: 0; padding: 0; border: 0; }
.forge-controls legend { margin-bottom: .45rem; color: #b6c4b9; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.power-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }
.power-options label { display: grid; grid-template-columns: auto 1fr; gap: 0 .5rem; padding: .6rem; border: 1px solid #395e48; background: #071a11; cursor: pointer; }
.power-options input { grid-row: 1 / 3; align-self: center; }
.power-options b { color: #d9b8ef; letter-spacing: .08em; }
.power-options span { color: #9daf9f; font-size: .7rem; }
.forge-button { width: 100%; padding: .85rem; }
.forge-controls > small { color: #93a398; line-height: 1.45; }
.forged-result {
  position: relative;
  min-height: 33rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-top: 3px solid var(--tier-color, #a65bce);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(5, 22, 15, .96), rgba(35, 17, 45, .89));
}
.result-glow { position: absolute; width: 22rem; height: 22rem; right: -8rem; top: -10rem; border-radius: 50%; background: rgba(157, 77, 196, .2); filter: blur(1.5rem); }
.forged-mark { float: right; display: grid; width: 5rem; height: 5rem; place-items: center; margin-left: 1rem; color: #e9c7fa; border: 1px solid #9f65bc; font-size: 2rem; transform: rotate(45deg); background: rgba(70, 27, 91, .7); }
.forged-result h2 { font-size: clamp(2rem, 5vw, 3.7rem); }
.forged-origin { color: #adbbae; }
.forged-stats { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1rem 0 .2rem; }
.forged-stats > div { min-width: 9rem; padding: .7rem .9rem; border: 1px solid rgba(119, 175, 142, .34); background: rgba(1, 13, 8, .56); }
.forged-stats small,.forged-stats em { display: block; color: #92a599; font-size: .68rem; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.forged-stats strong { display: block; color: #edf0e9; font: 1.55rem Georgia, serif; }
.forged-stats strong span { padding-left: .18rem; }
.forged-stats .stat-good { color: #62d892; }
.forged-stats .stat-bad { color: #ef726d; }
.improvement-ledger-grid { margin: 1rem 0; padding: .8rem; border: 1px solid rgba(119,175,142,.28); background: rgba(1,13,8,.5); }
.improvement-ledger-grid>small { color: #8ed6b3; letter-spacing: .11em; }
.improvement-ledger-grid>div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; margin-top: .6rem; }
.improvement-ledger-grid article { display: grid; gap: .08rem; padding: .55rem .65rem; border-left: 3px solid #77867b; background: rgba(0,0,0,.22); }
.improvement-ledger-grid article.magic { border-color: #bc6fe1; }
.improvement-ledger-grid article.quality { border-color: #e7c979; }
.improvement-ledger-grid article.physical { border-color: #5daaf2; }
.improvement-ledger-grid b { color: #aab8ad; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.improvement-ledger-grid strong { color: #e7d69e; font: 1rem Georgia,serif; }
.improvement-ledger-grid span { color: #aebbb0; font-size: .72rem; }
.inventory-stats { display: flex; gap: .45rem; margin: .65rem 0; }
.inventory-stats > span { flex: 1; padding: .45rem .55rem; border: 1px solid rgba(119, 175, 142, .26); background: rgba(1, 13, 8, .46); }
.inventory-stats small,.inventory-stats em { display: block; color: #92a599; font-size: .62rem; font-style: normal; text-transform: uppercase; }
.inventory-stats b { color: #edf0e9; font: 1.05rem Georgia, serif; }
.inventory-stats b i { padding-left: .12rem; font-style: normal; }
.inventory-stats .stat-good { color: #62d892; }
.inventory-stats .stat-bad { color: #ef726d; }
.equipment-set { margin: .65rem 0; padding: .6rem .7rem; border-left: 2px solid var(--tier-color, var(--market-gold)); background: rgba(1, 13, 8, .5); }
.equipment-set b { color: #91d8b1; font-size: .66rem; letter-spacing: .13em; }
.mount-profile>ul{display:grid;grid-template-columns:1fr;margin:.45rem 0 0;padding:0;list-style:none}.mount-profile>ul li{color:#c9d9cd;font-size:.74rem}.mount-profile>ul li strong{color:var(--tier-color,#91d8b1);font-size:inherit;letter-spacing:0;text-transform:none}
.equipment-set ul,
.set-card ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .18rem .8rem; margin: .4rem 0 0; padding: 0; list-style: none; }
.equipment-set li,
.set-card li { color: #c9d2ca; font-size: .78rem; line-height: 1.35; }
.equipment-set li::before,
.set-card li::before { content: '·'; margin-right: .35rem; color: var(--tier-color, var(--market-gold)); }
.set-card { margin: .55rem 0; padding: .55rem .65rem; border-left: 2px solid var(--tier-color, var(--market-gold)); background: rgba(1, 13, 8, .42); }
.set-card > b { color: var(--tier-color, #91d8b1); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.combat-profile { display: grid; gap: .15rem; margin: .55rem 0; padding: .45rem .55rem; border-left: 2px solid #d0b66c; background: rgba(0, 0, 0, .18); }
.combat-profile b { color: #e8d497; font-size: .78rem; }
.combat-profile span { color: #aebcb1; font-size: .75rem; }
.catalog-stats { display: flex; flex-wrap: wrap; gap: .25rem; margin: .4rem 0; }
.catalog-stats > span { flex: 1 1 3.5rem; min-width: 0; padding: .3rem .35rem; border: 1px solid rgba(119, 175, 142, .25); background: rgba(1, 13, 8, .42); }
.catalog-stats small,.catalog-stats em { display: block; color: #91a397; font-size: .58rem; font-style: normal; text-transform: uppercase; }
.catalog-stats b { color: #edf0e9; font: 1rem Georgia, serif; }
.catalog-stats i { padding-left: .12rem; font-style: normal; }
.catalog-stats .stat-good { color: #62d892; }
.catalog-stats .stat-bad { color: #ef726d; }
.item-weight { display: block; margin-top: .45rem; }
.forged-quality,
.forged-powers,
.forged-physical { display: grid; gap: .35rem; margin-top: 1.4rem; padding: 1rem; border-left: 3px solid var(--market-gold); background: rgba(1, 13, 8, .5); }
.forged-quality small,
.forged-powers > small,
.forged-physical > small { color: #8ed6b3; letter-spacing: .1em; }
.forged-quality strong { color: #efd68e; font: 1.35rem Georgia, serif; }
.forged-quality span { color: #d1d9d2; }
.forged-powers { border-left-color: #a65bce; }
.forged-powers article { padding: .6rem 0; border-top: 1px solid rgba(180, 111, 214, .24); }
.forged-powers article:first-of-type { border-top: 0; }
.forged-powers b { color: #ddb9ef; }
.forged-powers p { margin: .25rem 0 0; color: #cbd3cc; }
.forged-physical { border-left-color: #5daaf2; }
.forged-physical article { padding: .45rem 0; }
.forged-physical b { color: #9dcbf5; }
.forged-physical p { margin: .25rem 0 0; color: #cbd3cc; }
.forged-result footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(231, 201, 121, .35); }
.forged-result footer span { color: #9faf9f; }
.forged-result footer strong { color: #efd68e; }
.forge-empty { display: grid; min-height: 27rem; place-content: center; text-align: center; }
.forge-empty > span { color: #c08de0; font-size: 4rem; }
.forge-empty p { color: #a9b7ac; }

@media (max-width: 1050px) {
  .market-layout { grid-template-columns: 1fr; }
  .market-inventory { position: static; max-height: none; }
  .market-grid { grid-template-columns: 1fr; }
  .forge-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .market-shell { padding: .65rem; background-position: 66% top; background-attachment: scroll; }
  .market-hero, .goods-strip { grid-template-columns: 1fr; }
  .purse { min-width: 0; }
  .market-toolbar { align-items: stretch; flex-direction: column; }
  .market-search { min-width: 0; width: 100%; }
  .market-grid { padding: .6rem; }
  .catalog-families { padding: .5rem .6rem; }
  .equipment-set ul, .set-card ul { grid-template-columns: 1fr; }
  .quality-picker form { grid-template-columns: 1fr; }
  .improvement-ledger-grid>div { grid-template-columns: 1fr; }
  .quality-guide p { grid-template-columns: 1fr; gap: .1rem; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; padding-left: 4.6rem; }
  .tool-emblem { left: 1rem; width: 2.4rem; height: 2.4rem; }
  .forged-result footer { display: grid; }
}
