/* ── Window frame ── */
.window { position: fixed; display: flex; flex-direction: column; gap: 6px; max-width: calc(1920px - 16px); max-height: calc(1080px - var(--navbar-h) - 12px); outline: none; }
.window:focus-visible { outline: none; }
.win-scrim { position: fixed; inset: 0; background: #00000078; display: grid; place-items: center; }
.win-scrim > .window { position: static; }
.win-bar { display: flex; align-items: center; justify-content: space-between; min-height: 30px; cursor: move; touch-action: none; flex: none; }
.win-scrim .win-bar { cursor: var(--cursor); justify-content: center; }
.win-title { font: var(--size-heading)/1.1 var(--font-title); color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-close { width: 30px; height: 30px; flex: none; margin: -4px -6px -4px 8px; padding: 0; border: 0; background: none; }
.window > .rule { margin: 0; flex: none; }
.win-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.tab-body { display: flex; flex-direction: column; gap: 6px; min-height: 0; padding-top: 6px; }
.tab-body.col > * { flex-shrink: 0; }
.tab-body.col > .grow, .tab-body.col > .recess.scroll { flex: 1 1 0; min-height: 80px; }
.top { align-items: flex-start; }
.row.top.grow { align-items: stretch; }
.tight { gap: 1px; }
.amount { width: 96px; flex: none; }
.icon-btn.tiny { width: 20px; height: 20px; }
.item-grid { padding: 2px; align-content: start; }
.win-body > .detail-box { height: 98px; overflow: auto; }
.trade-list { height: 150px; }

/* ── Esc menu ── */
.esc-menu .win-body { align-items: center; gap: 8px; }
.esc-btn { width: 280px; min-height: 46px; font-size: 19px; }

/* ── Settings ── */
.settings-win { height: min(760px, calc(1080px - var(--navbar-h) - 24px)); }
.settings-body { flex: 1 1 0; padding-right: 8px; }
.setting { padding: 3px 0; }
.setting-control { width: 46%; flex: none; display: flex; }
.hint.flush { margin-left: 0; }
.restore { margin-top: 12px; }
.binds { display: flex; flex-direction: column; }
.bind-row { display: flex; align-items: center; gap: 6px; padding: 2px 6px; }
.bind-row:nth-child(odd) { background: #ffffff08; }
.bind-key { width: 150px; }

/* ── Character sheet ── */
.stats-cols { align-items: stretch; gap: 22px; }
.stats-cols > * { gap: 2px; }
.skill-list { max-height: 420px; }
.skill-row { align-items: center; }

/* ── Support ── */
.support-win .tab-body, .gm-win .win-body, .catalog-win .win-body { flex: 1 1 0; }
.support-win textarea { min-height: 150px; }
.report { padding: 6px; border-bottom: 1px solid var(--hairline); }
.report-body { white-space: pre-wrap; user-select: text; -webkit-user-select: text; }

/* ── GM ── */
.gm-cols { align-items: stretch; gap: 12px; min-height: 0; }
.gm-roster { width: 230px; flex: none; }
.gm-body { flex: 1 1 0; padding-right: 6px; }
.gm-line { gap: 6px; margin-bottom: 2px; }
.gm-in { min-height: 28px; width: auto; }
.gm-line select.input { width: auto; min-height: 28px; }
.gm-results { height: 150px; flex: none; }
.gm-log { height: 96px; flex: none; padding: 0 6px; user-select: text; -webkit-user-select: text; }
.gm-log p { margin: 0; }

/* ── Social ── */
.party-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-bottom: 1px solid var(--hairline); }
.party-friends { max-height: 168px; }
/* The kick's column in a row that has no kick (our own), as wide as the button: the bars line up. */
.party-kick-slot { flex: none; width: 30px; }
[data-theme="vanguard"] .party-kick-slot { width: 32px; }
.letter { padding: 4px 8px; max-height: 180px; overflow: auto; user-select: text; -webkit-user-select: text; }
.key-row { min-height: 48px; }

/* ── Quests ── */
.quest-cols { gap: 12px; min-height: 0; }
.quest-list { width: 250px; flex: none; }
.quest-page { padding-right: 6px; }
.quest-page .heading { font-size: 20px; }

/* ── Pass / achievements ── */
.pass-row { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 10px; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--hairline); opacity: .7; }
.pass-row.reached, .pass-row.head { opacity: 1; }
.pass-row.head { color: var(--gold); font-size: var(--size-small); position: sticky; top: 0; background: var(--bg-sunken); }
.achv { padding: 5px 8px; border-bottom: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 2px; }
.achv.earned b { color: var(--gold); }

/* ── World map ── */
.map-stage { position: relative; flex: 1 1 0; min-height: 200px; overflow: hidden; cursor: grab; touch-action: none; }
.map-sheet { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; }
.map-sheet img { display: block; width: 100%; image-rendering: pixelated; }
.map-marks { position: absolute; inset: 0; pointer-events: none; }
/* The layers lie over one another: only what is drawn in each takes the pointer. */
.map-marks > * { pointer-events: auto; }
/* Labels and the player's mark keep their size whatever the zoom (--unzoom is 1 / zoom). */
.map-place { position: absolute; transform: translate(-50%, -50%) scale(var(--unzoom, 1)); font-size: 11px; white-space: nowrap; color: #fff; text-shadow: 0 0 2px #000, 0 1px 1px #000; }
.map-place.city { color: var(--accent); }
.map-place.dungeon { color: #ff9c8f; }
.map-pin { position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; transform: scale(var(--unzoom, 1)); background: #c8ccd4; box-shadow: 0 0 0 1px #000a; }
.map-pin.shop { background: #e8c26a; } .map-pin.bank { background: #6fd197; } .map-pin.priest { background: #9ad0ff; }
.map-pin.guard { background: #8b919e; } .map-pin.quest { background: #f2a94e; border-radius: 1px; transform: scale(var(--unzoom, 1)) rotate(45deg); }
.map-pin.exit { background: #fff; border-radius: 1px; box-shadow: 0 0 0 1px #000, 0 0 4px #fff; }
/* A service pin's name: beside the pin, shown only once the map is close enough (`.named`). */
.map-pin-name { display: none; position: absolute; transform-origin: 0 50%; transform: translate(calc(6px * var(--unzoom, 1)), -50%) scale(var(--unzoom, 1)); font-size: 11px; white-space: nowrap; color: #e9ebef; text-shadow: 0 0 2px #000, 0 1px 1px #000; pointer-events: none; }
.map-marks.named .map-pin-name { display: block; }
.map-pin-name.shop { color: #f1d38b; } .map-pin-name.bank { color: #9be3b6; } .map-pin-name.priest { color: #bfe2ff; } .map-pin-name.quest { color: #f7c583; } .map-pin-name.guard { color: #a9afbb; }
.map-search { position: relative; }
.map-away { flex: none; min-width: 96px; text-align: right; }
/* The area a place covers, where creatures live: an outline that lights up as one piece under
   the pointer and stays marked once picked. Its edges keep their width at any zoom. */
.map-area { position: absolute; box-sizing: border-box; border: calc(1.5px * var(--unzoom, 1)) solid #e8c26a8c; background: #e8c26a0f; cursor: pointer; }
.map-area.hostile { border-color: #ff8a7a99; background: #ff5a4d12; }
.map-area.lit { background: #e8c26a33; border-color: #f1d38b; }
.map-area.hostile.lit { background: #ff5a4d38; border-color: #ffb4a8; }
.map-area.chosen { background: #e8c26a4d; border-color: #fff; }
.map-area.hostile.chosen { background: #ff5a4d52; border-color: #fff; }
.map-body { flex: 1 1 0; min-height: 0; display: flex; gap: 8px; }
.map-place { cursor: pointer; }
.map-place:hover { text-decoration: underline; }
.map-side { flex: none; width: 290px; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 2px 6px; overflow: hidden; }
.map-creatures { flex: 0 1 34%; min-height: 64px; overflow: auto; }
.map-creature { flex: 1 1 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line, var(--border-dim)); }
.map-creature-head { display: flex; gap: 10px; align-items: center; }
.map-creature-figure { flex: none; width: 76px; height: 86px; display: grid; place-items: center; overflow: hidden; }
.map-creature-figure img { max-width: 100%; max-height: 100%; object-fit: contain; }
.map-creature-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; font-size: var(--size-small); }
.map-creature-drops { display: flex; flex-direction: column; gap: 2px; }
.map-drop-icon { width: 24px; height: 24px; object-fit: contain; flex: none; }
/* The same card in its own window, for a creature right-clicked in the world, with what it says of itself. */
.npc-card { display: flex; flex-direction: column; gap: 6px; }
.creature-says { margin: 0; font-style: italic; color: var(--text-dim); }
.map-results { left: 0; top: 100%; width: min(460px, 100%); max-height: 300px; overflow: auto; display: flex; flex-direction: column; padding: 2px; }
.map-me { transform: scale(var(--unzoom, 1)); position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--danger), 0 0 8px #fff; }
.charinfo-figure { width: 130px; height: 150px; flex: none; align-items: center; justify-content: flex-end; padding-bottom: 12px; }

/* ── Catalog ── */
.catalog-cols { gap: 10px; min-height: 0; }
.catalog-list { width: 280px; flex: none; }
.catalog-form { padding: 2px 8px; }
.catalog-field { display: grid; grid-template-columns: 180px 1fr; gap: 8px; align-items: center; padding: 1px 0; }
.catalog-field .input { min-height: 28px; }

/* A tab with something waiting: in the accent, with the count in the red disc of the quick buttons. */
.tab[data-count] { color: var(--accent); }
.tab[data-count]::after { content: attr(data-count); display: inline-block; min-width: 16px; height: 16px; margin-left: 6px; padding: 0 4px; border-radius: 8px;
  background: #c8372c; color: #fff; font: 11px/16px var(--font-ui); letter-spacing: 0; text-align: center; vertical-align: 1px; box-shadow: 0 0 0 2px var(--bg); }

/* The GM panel's creature list with the sheet of the one picked beside it. */
.gm-npc-pick { align-items: stretch; gap: 8px; }
.gm-npc-pick > .gm-results { flex: 1 1 0; min-width: 0; }
.gm-npc-card { flex: 0 0 220px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }

/* The GM account page: a form row mutes the field and states the value; a list row leads with the datum. */
.gm-inspect { margin-bottom: 6px; }
.gm-inspect-rows { display: flex; flex-direction: column; gap: 2px; }
.gm-inspect-row { display: flex; gap: 10px; font-size: 13px; }
.gm-inspect-row > span:first-child { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-inspect-row > span:last-child { text-align: right; }
.gm-inspect-row.list > span:first-child { color: inherit; }
.gm-inspect-row.list > span:last-child { color: var(--text-muted); }
/* The GM roster's filters, one under another in the narrow column. */
.gm-filters { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.gm-filters .row { gap: 4px; }

/* The review queue's bounds asked of the server: dates and names, labelled above each box. */
.report-bounds { gap: 6px; }
.report-bound { flex: 1 1 120px; gap: 2px; }
.report-bound .input { width: 100%; }
/* A catalogue row's sub-list (drops, stock, objectives...) as a small table of boxes. */
.catalog-child { margin-top: 8px; }
.catalog-table { width: 100%; border-collapse: collapse; }
.catalog-table th { text-align: left; font-weight: normal; padding: 2px 4px; }
.catalog-table td { padding: 2px 4px; }
.catalog-table .input { width: 100%; min-width: 0; }

/* Messages as a chat: conversations on the left, the thread on the right, ours on the right side. */
.dm { gap: 8px; min-height: 0; align-items: stretch; }
.dm-side { width: 190px; flex: none; gap: 6px; min-height: 0; }
.dm-new .input { flex: 1; min-width: 0; }
.dm-list { min-height: 0; }
.dm-conv { align-items: center; gap: 6px; }
.dm-conv .col { min-width: 0; }
.dm-name { font-weight: 600; }
.dm-snippet { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-unread { position: static; }
.dm-thread { min-width: 0; min-height: 0; gap: 6px; }
.dm-head { align-items: center; }
.dm-msgs { display: flex; flex-direction: column; gap: 6px; padding: 8px; min-height: 0; }
.dm-msg { align-self: flex-start; max-width: 78%; padding: 6px 10px 4px; border-radius: 12px 12px 12px 4px; background: #ffffff12; display: flex; flex-direction: column; gap: 2px; }
.dm-msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.dm-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-time { align-self: flex-end; font-size: 11px; color: var(--text-muted); }
.dm-compose { gap: 6px; align-items: flex-end; }
.dm-input { flex: 1; resize: none; min-height: 40px; }

/* ── The auction house (panels/auction.js) and the vault's tabs ─────────────────────────── */
.win-body .tabs.row { gap: 4px; margin-bottom: 6px; align-items: center; }
.btn.tab { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.btn.tab[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.btn.tab.dim { opacity: .6; }
.btn.tab .badge { position: static; display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #111; font-size: 11px; line-height: 16px; text-align: center; }
.lot-list { display: flex; flex-direction: column; gap: 2px; max-height: 460px; min-height: 160px; padding: 4px; }
.lot-row { display: grid; grid-template-columns: 40px minmax(140px, 1fr) auto 110px 90px auto; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 4px; background: #ffffff06; }
.lot-row:hover { background: #ffffff10; }
.lot-row.mine { box-shadow: inset 3px 0 0 var(--accent); }
.lot-row .col { display: flex; flex-direction: column; min-width: 0; }
.lot-row .gold { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lot-row .row.end { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.lot-row .amount { width: 90px; }
.lot-icon { position: relative; width: 36px; height: 36px; }
.lot-icon img { width: 100%; height: 100%; object-fit: contain; }
.lot-icon .amt { position: absolute; right: 0; bottom: -2px; font-size: 11px; color: #fff; text-shadow: 0 0 2px #000; }
.field-inline { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.field-inline .input { width: 140px; }
.small.ok, .ok { color: var(--ok, #7bd88f); }
/* What each patronage plan opens (panels/progress.js, "perks"). */
.perks-table { display: grid; gap: 2px; padding: 6px; }
.perks-row { display: grid; grid-template-columns: 1.6fr repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; align-items: center; padding: 3px 4px; }
.perks-row.head { border-bottom: 1px solid var(--border); }
.perks-row > :not(:first-child) { text-align: center; }
.auction-filters { align-items: center; gap: 6px; }
.auction-filters > .input { width: auto; flex: 0 0 170px; }
.auction-filters > input.input { flex: 1 1 220px; }
