/* ======================================
   THE MARKET - the realm's businesses

   The sections (stalls, forge and tailor, property, businesses here) are
   chosen from the shared centered underline tabs (.sec-tabs, controls.css)
   since 2026-08-11 - the big banner nav cards this file used to style are
   gone at the owner's request, and their rules went with them. Each
   section's one-line description is drawn under the bar by market.js.
   ====================================== */

/* -- THE MARKET IN THE MANUSCRIPT (stage 2, 2026-09-30) -----------------
   The purse over the tabs is a figure in the book face; each stall is a
   heading ruled across the leaf with a gilt lozenge, not a purple box with a
   gold edge; the wares open under it as the Inventory's ruled lines. */
.market-purse {
  font-family: var(--font-serif);
  font-size: 1.2143rem;
  font-weight: 600;
  font-variant-numeric: lining-nums;
  color: var(--accent-gold);
}
.market-stall { margin: 0; }
.market-stall-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.7rem 0.1rem 0.6rem;
  border-bottom: 1px dotted var(--gild-faint);
  cursor: pointer;
}
.market-stall-head::before {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-right: 0.15rem;
  transform: translateY(-2px) rotate(45deg);
  background: var(--accent-gold);
}
.market-stall-name {
  font-family: var(--font-display);
  font-variant: small-caps;
  font-size: 1.2857rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}
@media (hover: hover) { .market-stall-head:hover .market-stall-name { color: var(--accent-gold); } }
.market-stall-count {
  margin-left: auto;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-small);
  color: var(--text-muted);
}
.market-stall-chev { color: var(--gild); font-size: 0.8em; }
.market-stall-wares { margin: 0.1rem 0 0.6rem 1.1rem; }
.market-stall:last-child .market-stall-head { border-bottom: 0; }
.market-stall:last-child .market-stall-head[aria-expanded="true"] { border-bottom: 1px dotted var(--gild-faint); }

/* -- The realm's businesses: a card per holding, expandable for the sign -- */

.biz-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* a business is a small leaf (stage 2, 2026-09-30) */
.biz-card {
  border: 1px solid var(--gild-faint);
  border-radius: 2px;
  background: var(--leaf);
  box-shadow: var(--vellum-shadow);
  overflow: hidden;
  transition: border-color 0.15s;
}
.biz-card.open  { border-color: var(--accent-gold); }
.biz-card.mine  { border-left: 3px solid var(--accent-gold); }
/* In a leaf, one box deep: the businesses are ruled lines; an open one is
   marked with the gilt rule down its edge. */
.panel-card .biz-list { gap: 0; }
.panel-card .biz-card { background: none; border: 0; border-bottom: 1px dotted var(--gild-faint); border-radius: 0; box-shadow: none; }
.panel-card .biz-card:last-child { border-bottom: 0; }
.panel-card .biz-card.open { box-shadow: inset 2px 0 0 var(--accent-gold); }
.panel-card .biz-card.mine { box-shadow: inset 3px 0 0 var(--accent-gold); }
.panel-card .biz-row { padding: 0.6rem 0.2rem 0.6rem 0.6rem; }

.biz-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
}
.biz-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-size: 1.1786rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.biz-kind {
  font-family: var(--font-serif);
  font-style: italic;
  font-variant: normal;
  letter-spacing: 0;
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-weight: 400;
}
.biz-owner {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-small);
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biz-expand {
  border-top: 1px dotted var(--gild-faint);
  padding: 0.6rem;
  background: rgba(212, 174, 90, 0.04);
}
.biz-banner {
  width: 100%;
  max-height: 130px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--gild-faint);
  margin-bottom: 0.5rem;
  display: block;
}
.biz-desc {
  font-family: var(--font-serif);
  font-size: var(--fs-text);
  color: var(--text-secondary);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 0.4rem;
}
.biz-meta {
  font-size: var(--fs-fine);
  color: var(--text-muted);
}

/* A thin progress bar for a business still going up. */
.biz-progress {
  height: 4px;
  background: var(--bg-surface);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.3rem;
  border: 1px solid var(--border-dim);
}
.biz-progress > span {
  display: block;
  height: 100%;
  background: var(--accent-ember);
}

/* WHAT A BUSINESS SELLS (2026-07-30). One row per service: what it is, what it
   does for you, what it costs, and - when you may not have it - why, printed on
   the card rather than left behind a click. */
.biz-svc-list {
  margin-top: 0.5rem;
  border-top: 1px dotted var(--gild-faint);
  padding-top: 0.4rem;
}
.biz-svc {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}
.biz-svc + .biz-svc { border-top: 1px dotted var(--gild-faint); }
.biz-svc-info { min-width: 0; }
.biz-svc-name { font-size: var(--fs-text); color: var(--text-primary); }
.biz-svc-meta { font-size: var(--fs-fine); color: var(--text-muted); margin-top: 0.1rem; }
.biz-svc-cut { color: var(--accent-gold); opacity: 0.85; }
.biz-svc-buy {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.biz-svc-price {
  color: var(--accent-gold);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
.biz-svc-buy .inv-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* The reason a button is dead, spanning both columns underneath it. The title=
   attribute carries the same words for anyone hovering. */
.biz-svc-why {
  grid-column: 1 / -1;
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-style: italic;
}

/* -- SELLING SEVERAL AT ONCE (the QoL pass, 2026-09-18, item 3.4) ------ */
/* No strip behind it (maggie, 2026-10-15: "this is looking odd" - a flat dark
   band across the textured card): the button alone stays in view, on the right. */
.sell-bar { position: sticky; top: 0; z-index: 2; padding: 0.3rem 0; background: none; display: flex; justify-content: flex-end; pointer-events: none; }
.sell-bar .btn { pointer-events: auto; font-size: var(--fs-small); padding: 0.3rem 0.8rem; }
.sell-tick { display: flex; align-items: center; padding-right: 0.5rem; min-width: var(--tap-min); min-height: var(--tap-min); justify-content: center; }
.sell-tick input { width: 1.1rem; height: 1.1rem; }
/* -- THE MEDICINE ORDERS ON THE PLAYER MARKET (2026-10-15) --------------- */
.medorders-section { margin-top: 1rem; }
.medorder-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: flex-end; margin: 0.6rem 0; }
