/* ===========================================================================
   Work-mode panel kit (`wm-ui-*`)
   ---------------------------------------------------------------------------
   Shared chrome and widgets for every work-mode panel: the message frame that
   ui/workMode/readerFrame.js builds, and the rows, spreadsheets, buttons and
   form controls in ui/workMode/widgets.js.

   Panel-specific rules live next to their panel, prefixed `wm-<panel>-`; this
   file must stay panel-agnostic so a new panel inherits the whole look.
   Every rule has a dark-theme counterpart at the bottom of the file, under
   `body.work-mode-active.work-mode-dark`.
   ======================================================================== */

.wm-ui-reader {
  position: absolute;
  inset: 0;
  background: #ffffff;
  color: #222;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

/* --- Header ------------------------------------------------------------- */

.wm-ui-reader-header {
  padding: 16px 24px 10px;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}
.wm-ui-reader-subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wm-ui-reader-subject { font-size: 20px; font-weight: 600; }
.wm-ui-reader-tools { display: flex; gap: 4px; }
.wm-ui-tool {
  min-width: 28px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #444;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.wm-ui-tool:hover { background: #f0f0f0; border-color: #d6d6d6; }
.wm-ui-tool--on { background: #deecf9; border-color: #c7e0f4; color: #0078d4; }
.wm-ui-reader-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-top: 6px;
}
.wm-ui-reader-sender { color: #0078d4; font-weight: 600; }
.wm-ui-reader-status { color: #888; font-variant-numeric: tabular-nums; }
.wm-ui-reader-intro { font-size: 13px; font-style: italic; color: #555; margin-top: 8px; }

/* --- Attachment-chip tabs ----------------------------------------------- */

.wm-ui-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wm-ui-attachment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  background: #fafafa;
  border: 1px solid #d6d6d6;
  border-radius: 2px;
  color: #333;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.wm-ui-attachment:hover { background: #f0f0f0; }
.wm-ui-attachment--active { background: #deecf9; border-color: #0078d4; color: #004578; font-weight: 600; }
.wm-ui-attachment-icon { font-size: 12px; opacity: 0.7; }
.wm-ui-attachment-flag {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e8a317;
  border: 1px solid #fff;
}

/* --- Body + footer ------------------------------------------------------ */

.wm-ui-reader-body {
  flex: 1;
  padding: 16px 24px;
  font-size: 14px;
  line-height: 1.55;
  overflow-y: auto;
}
.wm-ui-reader-body p { margin: 0 0 12px; max-width: 70ch; }
.wm-ui-reader-footer {
  flex-shrink: 0;
  padding: 6px 24px;
  border-top: 1px solid #e0e0e0;
  font-size: 11px;
  color: #888;
}
.wm-ui-note { color: #777; }
.wm-ui-status {
  margin: 0 0 12px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #f1dc93;
  background: #fff4ce;
  color: #5c4a00;
}
.wm-ui-status--error { background: #fde7e9; border-color: #f1bbbc; color: #a4262c; }
.wm-ui-status--good { background: #dff6dd; border-color: #a7d9a3; color: #0b6a0b; }

/* --- Buttons + fields --------------------------------------------------- */

.wm-ui-button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.wm-ui-disabled-wrap { display: inline-flex; }
.wm-ui-btn {
  background: #f0f0f0;
  color: #222;
  border: 1px solid #ccc;
  padding: 4px 14px;
  border-radius: 2px;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.wm-ui-btn:hover:not(:disabled) { background: #e0e0e0; }
.wm-ui-btn:disabled { color: #a6a6a6; background: #f8f8f8; border-color: #e1e1e1; cursor: default; }
.wm-ui-btn--primary { background: #0078d4; border-color: #0067b8; color: #fff; }
.wm-ui-btn--primary:hover:not(:disabled) { background: #106ebe; }
.wm-ui-btn--danger { background: #a4262c; border-color: #8e1f24; color: #fff; }
.wm-ui-btn--danger:hover:not(:disabled) { background: #8e1f24; }
.wm-ui-btn--small { padding: 2px 10px; min-width: 34px; font-size: 12px; }
.wm-ui-btn:focus-visible,
.wm-ui-attachment:focus-visible,
.wm-ui-tool:focus-visible,
.wm-ui-sheet-row:focus-visible,
.wm-ui-input:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
}

.wm-ui-field { display: inline-flex; align-items: center; gap: 8px; margin: 0 12px 8px 0; font-size: 13px; }
.wm-ui-field-label { color: #444; }
.wm-ui-field-hint { color: #888; font-size: 12px; }
.wm-ui-input {
  border: 1px solid #ccc;
  border-radius: 2px;
  padding: 3px 8px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: #222;
  width: 110px;
}
.wm-ui-input--text { width: 200px; }
.wm-ui-input:focus { border-color: #0078d4; outline: none; }

/* --- Item cells --------------------------------------------------------- */

.wm-ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}
.wm-ui-cell-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wm-ui-cell-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-ui-cell-suffix { color: #888; font-size: 12px; flex-shrink: 0; }

/* --- Spreadsheet -------------------------------------------------------- */

.wm-ui-section {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #0078d4;
  margin: 14px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #e0e0e0;
}
.wm-ui-sheet { margin-bottom: 14px; font-size: 13px; }
.wm-ui-sheet-head,
.wm-ui-sheet-row {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  text-align: left;
}
.wm-ui-sheet-head {
  background: #f3f3f3;
  border: 1px solid #e0e0e0;
  border-bottom-color: #d6d6d6;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.wm-ui-sheet-letter {
  display: inline-block;
  min-width: 14px;
  margin-right: 6px;
  color: #a6a6a6;
  font-weight: 400;
}
.wm-ui-sheet-row {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  font: inherit;
  font-size: 13px;
  color: #222;
  cursor: default;
  counter-increment: none;
}
button.wm-ui-sheet-row { cursor: pointer; }
button.wm-ui-sheet-row:hover { background: #f5f5f5; }
.wm-ui-sheet-row--on { background: #deecf9; }
.wm-ui-sheet-row--dim { color: #999; }
.wm-ui-sheet-row--dim .wm-ui-icon { opacity: 0.5; }
.wm-ui-sheet-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wm-ui-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wm-ui-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ===========================================================================
   Dark theme
   ======================================================================== */

body.work-mode-active.work-mode-dark .wm-ui-reader { background: #1a1a1a; color: #e6e6e6; }
body.work-mode-active.work-mode-dark .wm-ui-reader-header,
body.work-mode-active.work-mode-dark .wm-ui-reader-footer { border-color: #333; }
body.work-mode-active.work-mode-dark .wm-ui-reader-sender { color: #4da6ff; }
body.work-mode-active.work-mode-dark .wm-ui-reader-intro,
body.work-mode-active.work-mode-dark .wm-ui-field-label { color: #bbb; }
body.work-mode-active.work-mode-dark .wm-ui-note,
body.work-mode-active.work-mode-dark .wm-ui-reader-status,
body.work-mode-active.work-mode-dark .wm-ui-cell-suffix,
body.work-mode-active.work-mode-dark .wm-ui-field-hint { color: #888; }
body.work-mode-active.work-mode-dark .wm-ui-tool { color: #ccc; }
body.work-mode-active.work-mode-dark .wm-ui-tool:hover { background: #2a2a2a; border-color: #444; }
body.work-mode-active.work-mode-dark .wm-ui-tool--on,
body.work-mode-active.work-mode-dark .wm-ui-attachment--active,
body.work-mode-active.work-mode-dark .wm-ui-sheet-row--on { background: #0b3a5e; border-color: #4da6ff; color: #e6f2ff; }
body.work-mode-active.work-mode-dark .wm-ui-attachment,
body.work-mode-active.work-mode-dark .wm-ui-btn,
body.work-mode-active.work-mode-dark .wm-ui-input { background: #242424; border-color: #444; color: #e6e6e6; }
body.work-mode-active.work-mode-dark .wm-ui-attachment:hover,
body.work-mode-active.work-mode-dark .wm-ui-btn:hover:not(:disabled),
body.work-mode-active.work-mode-dark button.wm-ui-sheet-row:hover { background: #333; }
body.work-mode-active.work-mode-dark .wm-ui-btn:disabled { background: #1f1f1f; border-color: #333; color: #666; }
body.work-mode-active.work-mode-dark .wm-ui-btn--primary { background: #0078d4; border-color: #2b88d8; color: #fff; }
body.work-mode-active.work-mode-dark .wm-ui-btn--danger { background: #a4262c; border-color: #c4383e; color: #fff; }
body.work-mode-active.work-mode-dark .wm-ui-attachment-flag { border-color: #1a1a1a; }
body.work-mode-active.work-mode-dark .wm-ui-status { background: #3d3510; border-color: #7a6512; color: #f3dc8a; }
body.work-mode-active.work-mode-dark .wm-ui-status--error { background: #3b1a1c; border-color: #6e2a2e; color: #f1a8ac; }
body.work-mode-active.work-mode-dark .wm-ui-status--good { background: #14300f; border-color: #2d5c27; color: #a7d9a3; }
body.work-mode-active.work-mode-dark .wm-ui-section { color: #4da6ff; border-color: #2a2a2a; }
body.work-mode-active.work-mode-dark .wm-ui-sheet-head { background: #202020; border-color: #333; color: #bbb; }
body.work-mode-active.work-mode-dark .wm-ui-sheet-letter { color: #666; }
body.work-mode-active.work-mode-dark .wm-ui-sheet-row { color: #e6e6e6; border-color: #2a2a2a; }
body.work-mode-active.work-mode-dark .wm-ui-sheet-row--dim { color: #888; }

/* ── Bank ────────────────────────────────────────────────────────────────── */
.wm-bank-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}
.wm-bank-side { min-width: 0; }
.wm-bank-search { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.wm-bank-search .wm-ui-input { flex: 1; min-width: 0; }
.wm-bank-heading { font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.wm-bank-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.wm-bank-tab {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
  padding: 3px 9px; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer;
  background: #f3f2f1; color: #323130; border: 1px solid #d2d0ce; border-radius: 3px;
}
.wm-bank-tab:hover { background: #e1dfdd; }
.wm-bank-tab--on { background: #deecf9; border-color: #0078d4; color: #004578; font-weight: 600; }
.wm-bank-tab--new { color: #0078d4; }
.wm-bank-tab .wm-ui-icon { width: 16px; height: 16px; font-size: 10px; }
.wm-bank-tab-glyph { font-size: 13px; line-height: 1; }
.wm-bank-placeholder .wm-ui-icon { opacity: 0.4; }
.wm-bank-transfer-label { font-size: 13px; font-weight: 600; margin-right: 2px; }
.wm-bank-prompt-value {
  display: inline-block;
  min-width: 90px;
  min-height: 22px;
  margin: 4px 0;
  padding: 1px 6px;
  border: 1px solid #0078d4;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

/* ── Grand Exchange ──────────────────────────────────────────────────────── */
.wm-ge-split { display: grid; grid-template-columns: minmax(240px, 34%) 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .wm-ge-split { grid-template-columns: 1fr; } }
.wm-ge-left .wm-ui-input--text { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.wm-ge-left .wm-ui-sheet { max-height: 460px; overflow-y: auto; }
.wm-ge-empty { padding: 40px 12px; text-align: center; }
.wm-ge-item-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.wm-ge-item-head .wm-ui-cell-label { font-size: 16px; font-weight: 600; }
.wm-ge-item-meta { color: #605e5c; font-size: 12px; }
.wm-ge-books { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 560px) { .wm-ge-books { grid-template-columns: 1fr; } }
.wm-ge-book .wm-ui-sheet { max-height: 220px; overflow-y: auto; }
.wm-ge-book-title { font-weight: 600; font-size: 12px; margin-bottom: 4px; padding-left: 8px; border-left: 3px solid; }
.wm-ge-book--ask .wm-ge-book-title { border-color: #c4314b; }
.wm-ge-book--bid .wm-ge-book-title { border-color: #107c10; }
.wm-ge-book-trader { float: right; font-weight: 400; font-size: 11px; opacity: 0.7; }
.wm-ge-form { border: 1px solid #e0e0e0; border-left: 3px solid #107c10; padding: 10px 14px 6px; }
.wm-ge-form--sell { border-left-color: #c4314b; }
.wm-ge-form-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.wm-ge-seg { display: inline-flex; }
.wm-ge-seg .wm-ui-btn { border-radius: 0; min-width: 64px; }
.wm-ge-seg .wm-ui-btn:first-child { border-radius: 2px 0 0 2px; }
.wm-ge-seg .wm-ui-btn:last-child { border-radius: 0 2px 2px 0; margin-left: -1px; }
.wm-ge-seg-buy { background: #107c10; border-color: #0b6a0b; color: #fff; }
.wm-ge-seg-sell { background: #c4314b; border-color: #a4262c; color: #fff; }
.wm-ge-owned { color: #605e5c; font-size: 12px; }
.wm-ge-source { display: flex; margin-bottom: 8px; }
.wm-ge-source .wm-ui-btn { flex: 1; }
.wm-ge-seg-source { background: #0078d4; border-color: #106ebe; color: #fff; }
.wm-ge-row-off { opacity: 0.5; cursor: default; }
.wm-ge-fields { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.wm-ge-qty { display: inline-flex; gap: 4px; align-items: center; }
.wm-ge-qty .wm-ui-input { width: 110px; }
.wm-ge-summary { display: flex; align-items: baseline; gap: 10px; margin: 6px 0; }
.wm-ge-total { font-size: 15px; }
.wm-ge-each { color: #605e5c; font-size: 12px; }
.wm-ge-submit-buy { background: #107c10; border-color: #0b6a0b; }
.wm-ge-submit-sell { background: #c4314b; border-color: #a4262c; }
.wm-ge-chip { display: inline-block; padding: 1px 6px; border-radius: 2px; font-size: 10px; font-weight: 700; color: #fff; }
.wm-ge-chip--buy { background: #107c10; }
.wm-ge-chip--sell { background: #c4314b; }
.wm-ge-progress { display: flex; align-items: center; gap: 8px; width: 100%; }
.wm-ge-progress-bar { flex: 1; height: 6px; background: #edebe9; border-radius: 3px; overflow: hidden; }
.wm-ge-progress-fill { display: block; height: 100%; }
.wm-ge-progress-fill--buy { background: #107c10; }
.wm-ge-progress-fill--sell { background: #c4314b; }
.wm-ge-progress-text { font-size: 11px; color: #605e5c; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Dark theme */
body.work-mode-active.work-mode-dark .wm-bank-prompt-value { background: #242424; border-color: #4da6ff; }
body.work-mode-active.work-mode-dark .wm-bank-tab { background: #242424; color: #e6e6e6; border-color: #3a3a3a; }
body.work-mode-active.work-mode-dark .wm-bank-tab:hover { background: #2e2e2e; }
body.work-mode-active.work-mode-dark .wm-bank-tab--on { background: #1b3a57; border-color: #4da6ff; color: #cfe6ff; }
body.work-mode-active.work-mode-dark .wm-bank-tab--new { color: #4da6ff; }
body.work-mode-active.work-mode-dark .wm-ge-form { border-color: #333; border-left-color: #6ccb5f; }
body.work-mode-active.work-mode-dark .wm-ge-form--sell { border-left-color: #f1707b; }
body.work-mode-active.work-mode-dark .wm-ge-item-meta,
body.work-mode-active.work-mode-dark .wm-ge-owned,
body.work-mode-active.work-mode-dark .wm-ge-each,
body.work-mode-active.work-mode-dark .wm-ge-progress-text { color: #a6a6a6; }
body.work-mode-active.work-mode-dark .wm-ge-progress-bar { background: #333; }

/* Each bank sheet scrolls in its own box (owner rule 2026-09-17): scrolling
   the vault must leave the inventory where it is. The sheet header is sticky
   inside its own scroller. */
.wm-bank-scroll {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  border-bottom: 1px solid #f0f0f0;
}
.wm-bank-scroll .wm-ui-sheet { margin-bottom: 0; }
body.work-mode-active.work-mode-dark .wm-bank-scroll { border-color: #2a2a2a; }

/* ── Crafting stations (requisition forms) ───────────────────────────────── */
.wm-station-note { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.wm-station-list { max-width: 720px; }
.wm-station-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 140px minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 6px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: #222;
  cursor: pointer;
}
button.wm-station-row:hover { background: #f5f5f5; }
.wm-station-row--static { cursor: default; }
.wm-station-row--open { background: #deecf9; }
.wm-station-row--blocked { color: #999; }
.wm-station-row--blocked .wm-ui-icon { opacity: 0.5; }
.wm-station-level { color: #777; font-size: 12px; white-space: nowrap; }
.wm-station-materials {
  color: #555;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wm-station-amounts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 8px 28px;
  background: #f3f9fd;
  border-bottom: 1px solid #deecf9;
}
.wm-station-amounts-label { font-size: 13px; font-weight: 600; margin-right: 4px; }
.wm-station-prompt-value {
  display: inline-block;
  min-width: 90px;
  min-height: 22px;
  margin: 4px 0;
  padding: 1px 6px;
  border: 1px solid #0078d4;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

body.work-mode-active.work-mode-dark .wm-station-row { color: #e6e6e6; border-color: #2a2a2a; }
body.work-mode-active.work-mode-dark button.wm-station-row:hover { background: #333; }
body.work-mode-active.work-mode-dark .wm-station-row--open { background: #0b3a5e; }
body.work-mode-active.work-mode-dark .wm-station-row--blocked { color: #888; }
body.work-mode-active.work-mode-dark .wm-station-level,
body.work-mode-active.work-mode-dark .wm-station-materials { color: #aaa; }
body.work-mode-active.work-mode-dark .wm-station-amounts { background: #1e2a33; border-color: #0b3a5e; }
body.work-mode-active.work-mode-dark .wm-station-prompt-value { background: #242424; border-color: #4da6ff; }

/* ── Shop / trade / courier ──────────────────────────────────────────────── */
.wm-shop-price { font-size: 13px; font-weight: 600; margin: 0 0 8px 2px; }
.wm-shop-no-buy { font-style: italic; margin-top: 8px; }
.wm-shop-community {
  border: 1px solid #e0e0e0;
  border-left: 3px solid #e8a317;
  padding: 8px 12px;
  margin-bottom: 14px;
  max-width: 620px;
}
.wm-shop-community-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wm-shop-community-tier { font-weight: 600; color: #8a5a00; }
.wm-shop-community-line { font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.wm-ui-bar { height: 8px; background: #edebe9; margin-top: 6px; }
.wm-ui-bar-fill { height: 100%; background: #e8a317; }
.wm-trade-status { font-size: 12px; color: #888; margin: 6px 0 0 2px; }
.wm-trade-status--ready { color: #107c10; font-weight: 600; }

body.work-mode-active.work-mode-dark .wm-shop-community { border-color: #333; border-left-color: #e8a317; }
body.work-mode-active.work-mode-dark .wm-shop-community-tier { color: #f3c969; }
body.work-mode-active.work-mode-dark .wm-ui-bar { background: #333; }
body.work-mode-active.work-mode-dark .wm-trade-status--ready { color: #54b054; }

/* ── Depots, farm, compost, riddle, dialog ───────────────────────────────── */

.wm-compost-essence { margin: 10px 0; max-width: 340px; }
.wm-compost-essence-row {
  display: grid;
  grid-template-columns: 90px 1fr 44px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}
.wm-compost-countdown { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Farm + compost cards: name and details on the left, buttons on the right. */
.wm-grow-list { display: flex; flex-direction: column; max-width: 720px; }
.wm-grow-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #222;
}
.wm-grow-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wm-grow-card-meta { font-size: 12px; color: #666; padding-left: 26px; }
.wm-grow-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.wm-grow-card--locked .wm-ui-cell-label,
.wm-grow-card--locked .wm-grow-card-meta { color: #999; }
.wm-grow-card--locked .wm-ui-icon { opacity: 0.5; }
.wm-grow-lock { font-size: 12px; color: #a4262c; white-space: nowrap; }
.wm-grow-level { margin: 0 0 6px; }
.wm-grow-meter { max-width: 340px; margin: 4px 0 8px; }
.wm-grow-meter-top { display: flex; justify-content: space-between; font-size: 13px; }
.wm-essence-chips { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.wm-essence-chip { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.wm-essence-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wm-essence-filler { font-style: italic; }
.wm-compost-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 28px; }
.wm-compost-pane { min-width: 0; }

.wm-riddle-text { font-style: italic; font-size: 15px; max-width: 60ch; }
.wm-dialog-text { font-size: 15px; max-width: 65ch; }
.wm-dialog-options { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; max-width: 620px; }
.wm-dialog-option { text-align: left; }

body.work-mode-active.work-mode-dark .wm-grow-card { color: #e6e6e6; border-color: #2a2a2a; }
body.work-mode-active.work-mode-dark .wm-grow-card-meta { color: #aaa; }
body.work-mode-active.work-mode-dark .wm-grow-card--locked .wm-ui-cell-label,
body.work-mode-active.work-mode-dark .wm-grow-card--locked .wm-grow-card-meta { color: #777; }
body.work-mode-active.work-mode-dark .wm-grow-lock { color: #f1707b; }

/* ── Equipment stats ─────────────────────────────────────────────────────── */
.wm-equip-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 720px; }
.wm-equip-slot {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
  padding: 6px 4px; background: #fafafa; border: 1px solid #e0e0e0; border-radius: 4px;
  font: inherit; font-size: 12px; color: #222; cursor: pointer;
}
.wm-equip-slot:hover:not(:disabled) { background: #f0f0f0; }
.wm-equip-slot:disabled { cursor: default; }
.wm-equip-slot--on { background: #deecf9; border-color: #0078d4; }
.wm-equip-slot-label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #888; }
.wm-equip-slot-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-equip-slot-qty { font-size: 11px; color: #888; font-variant-numeric: tabular-nums; }
.wm-equip-focus { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; margin: 8px 0 2px; max-width: 720px; }
.wm-equip-focus .wm-ui-note { margin: 0; }
.wm-equip-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 24px; max-width: 720px; }
.wm-equip-stat { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 13px; }
.wm-equip-stat-label { color: #555; }
.wm-equip-stat-value { text-align: right; font-variant-numeric: tabular-nums; }
.wm-equip-stat--bonus .wm-equip-stat-label,
.wm-equip-stat-bonus { color: #b8860b; font-weight: 600; }

body.work-mode-active.work-mode-dark .wm-equip-slot { background: #202020; border-color: #333; color: #e6e6e6; }
body.work-mode-active.work-mode-dark .wm-equip-slot:hover:not(:disabled) { background: #2a2a2a; }
body.work-mode-active.work-mode-dark .wm-equip-slot--on { background: #1e3a5a; border-color: #4da6ff; }
body.work-mode-active.work-mode-dark .wm-equip-stat-label { color: #bbb; }
body.work-mode-active.work-mode-dark .wm-equip-stat--bonus .wm-equip-stat-label,
body.work-mode-active.work-mode-dark .wm-equip-stat-bonus { color: #f3c969; }

/* ── World map ───────────────────────────────────────────────────────────── */
.wm-map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
/* The map fills the reader: body becomes a column and the viewport takes the
   rest of it, so the plan uses the whole window rather than half of it. */
.wm-ui-reader[data-wm-panel="world-map"] .wm-ui-reader-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wm-map-viewport {
  position: relative;
  flex: 1;
  min-height: 240px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d6d6d6;
  /* A pointer, not a grab hand: the main gesture is clicking where to walk. */
  cursor: pointer;
  touch-action: none;
}
.wm-map-plane { position: absolute; left: 50%; top: 50%; transform-origin: center; }
.wm-map-layer {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  user-select: none;
  max-width: none;   /* the plane is scaled; the bitmap keeps its natural size */
}
.wm-map-layer--pending { width: 100%; height: 100%; background: #f5f5f5; }
.wm-map-pin {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #d13438;
  box-shadow: 0 0 0 1px #fff;
}
.wm-map-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; cursor: pointer; user-select: none; }
/* Place names: a zero-size anchor on the travel point, counter-scaled so the
   label stays the same size on screen however far the plane is zoomed. */
.wm-map-city {
  position: absolute;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  transform: scale(var(--wm-label-scale, 1));
  pointer-events: none;   /* clicks fall through to travel */
  z-index: 2;             /* city names sit over local dots */
}
.wm-map-city::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  background: #fff;
  border: 1px solid #323130;
  transform: rotate(45deg);
}
.wm-map-city-name {
  position: absolute;
  bottom: 6px;
  left: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #323130;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.wm-map-city--below .wm-map-city-name { bottom: auto; top: 6px; }
.wm-map-city--hidden .wm-map-city-name { visibility: hidden; }
/* Local points: a small dot and smaller, lighter, sentence-case names. */
.wm-map-city--local { z-index: 1; }
.wm-map-city--local::before { left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%; transform: none; }
.wm-map-city--local .wm-map-city-name { bottom: 4.5px; font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; color: #605e5c; }
.wm-map-city--local.wm-map-city--below .wm-map-city-name { bottom: auto; top: 4.5px; }
/* Phone sheets show the game's colour map, so they get the game's map face. */
.wm-map-city--game::before { background: #f3e3b5; border-color: #1b120a; }
.wm-map-city--game .wm-map-city-name {
  font-family: "Cinzel", "Trajan Pro", Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: none;
  color: #f3e3b5;
  -webkit-text-stroke: 4px #1b120a;
  paint-order: stroke fill;
  text-shadow: none;
}
.wm-map-city--game.wm-map-city--local::before { background: #e6e0d2; }
.wm-map-city--game.wm-map-city--local .wm-map-city-name { font-size: 11px; color: #e6e0d2; -webkit-text-stroke: 3px #1b120a; }

/* ── Mirror ──────────────────────────────────────────────────────────────── */
.wm-mirror-layout { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.wm-mirror-preview { text-align: center; }
.wm-mirror-canvas {
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #fafafa 0% 50%) 50% / 16px 16px;
  border: 1px solid #d6d6d6;
}
.wm-mirror-panel { flex: 1; min-width: 260px; }
.wm-mirror-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.wm-mirror-swatch {
  width: 26px;
  height: 26px;
  border: 1px solid #b6b6b6;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
}
.wm-mirror-swatch--on { outline: 2px solid #0078d4; outline-offset: 1px; }
.wm-mirror-options { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.wm-mirror-unsaved { color: #8a5a00; font-style: italic; font-size: 13px; margin: 4px 0 8px; }

/* ── Summoner bench ──────────────────────────────────────────────────────── */
.wm-bench-base { border-left: 3px solid #0078d4; padding: 4px 0 4px 12px; margin-bottom: 14px; }
.wm-bench-row { grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1.4fr) 110px; }
.wm-bench-state { font-size: 12px; font-weight: 600; text-align: right; }
.wm-bench-detail { padding: 8px 6px 10px 28px; background: #f3f9fd; border-bottom: 1px solid #deecf9; }
.wm-bench-req { font-size: 12px; color: #a4262c; font-variant-numeric: tabular-nums; }
.wm-bench-req--met { color: #107c10; }

body.work-mode-active.work-mode-dark .wm-map-viewport { background: #1a1a1a; border-color: #333; }
/* The plan is printed in dark ink on paper; invert it for the dark theme
   rather than rendering a second bitmap. */
body.work-mode-active.work-mode-dark .wm-map-layer { filter: invert(1); }
body.work-mode-active.work-mode-dark .wm-map-layer--pending { background: #242424; filter: none; }
body.work-mode-active.work-mode-dark .wm-map-city:not(.wm-map-city--game)::before { background: #1a1a1a; border-color: #e6e6e6; }
body.work-mode-active.work-mode-dark .wm-map-city:not(.wm-map-city--game) .wm-map-city-name { color: #e6e6e6; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000, 0 0 3px #000, 0 0 3px #000; }
body.work-mode-active.work-mode-dark .wm-map-city--local:not(.wm-map-city--game) .wm-map-city-name { color: #b3b0ad; }
body.work-mode-active.work-mode-dark .wm-mirror-canvas { border-color: #444; background: repeating-conic-gradient(#242424 0% 25%, #2c2c2c 0% 50%) 50% / 16px 16px; }
body.work-mode-active.work-mode-dark .wm-mirror-swatch { border-color: #555; }
body.work-mode-active.work-mode-dark .wm-mirror-unsaved { color: #f3c969; }
body.work-mode-active.work-mode-dark .wm-bench-base { border-left-color: #4da6ff; }
body.work-mode-active.work-mode-dark .wm-bench-detail { background: #1e2a33; border-color: #0b3a5e; }
body.work-mode-active.work-mode-dark .wm-bench-req { color: #f1a8ac; }
body.work-mode-active.work-mode-dark .wm-bench-req--met { color: #54b054; }

/* ── Tab states + action progress ────────────────────────────────────────── */
/* A tab whose recipes can be made right now stands out; one with nothing
   available fades back. */
.wm-ui-attachment--ready { border-color: #107c10; box-shadow: inset 2px 0 0 #107c10; }
.wm-ui-attachment--ready .wm-ui-attachment-name { font-weight: 600; }
.wm-ui-attachment--dim { opacity: 0.55; }
.wm-ui-attachment--dim.wm-ui-attachment--active { opacity: 1; }

.wm-ui-progress { flex-shrink: 0; height: 4px; background: #edebe9; }
.wm-ui-progress-fill { height: 100%; background: #0078d4; transition: width 90ms linear; }

body.work-mode-active.work-mode-dark .wm-ui-attachment--ready { border-color: #54b054; box-shadow: inset 2px 0 0 #54b054; }
body.work-mode-active.work-mode-dark .wm-ui-progress { background: #2a2a2a; }
