.farm-sheet button { margin: 0; }
/* A centered game window, framed like the Mailbox: ribbon banner, readable
 * outlined text, and the red Back button beside the action. */
.farm-sheet {
  box-sizing: border-box;
  width: var(--game-window-width);
  max-width: calc(100vw - 24px);
  height: min(600px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px));
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--window-surface);
  color: var(--text);
  box-shadow: 0 20px 56px rgba(0,0,0,.72);
  font: 900 var(--font-readable-body)/1.35 var(--font-rounded);
  -webkit-text-stroke: var(--text-outline-width) #000;
  paint-order: stroke fill;
  text-shadow: var(--text-shadow);
}
.farm-sheet[open] { display: flex; flex-direction: column; }
.farm-sheet::backdrop { background: #0008; }
.farm-sheet:focus { outline: none; }
.farm-sheet button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.farm-header { flex-shrink: 0; padding: 18px 12px 2px; }
.farm-map { flex-shrink: 0; margin: 0 14px 8px; color: var(--muted); text-align: center; font-size: 12px; }
/* Shared rows: Home's travel portal, the Soul Dimension and Guild Hall windows reuse these. */
.farm-choices {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 14px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}
.farm-choices::-webkit-scrollbar { display: none; }
.farm-sheet .farm-enemy {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #1b1c1d;
  box-shadow: none;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.farm-sheet .farm-enemy[aria-pressed="true"] { border-color: var(--green); background: rgba(105,229,111,.08); box-shadow: 0 0 0 1px rgba(105,229,111,.35); }
.farm-enemy-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #0006;
  color: var(--farm-stat-color);
  font-size: 20px;
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.farm-enemy-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.farm-enemy-copy strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.farm-reward { color: var(--farm-stat-color); font-size: 12px; }
.farm-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  color: transparent;
  font-size: 12px;
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.farm-enemy[aria-pressed="true"] .farm-check { border-color: var(--green); background: var(--green); color: #0f0f0f; font-size: 13px; }
.farm-footer { flex-shrink: 0; padding: 8px 14px max(12px, env(safe-area-inset-bottom, 0px)); }
.farm-selection { min-height: 0; margin: 0 0 8px; color: #ffcf7a; text-align: center; font-size: 12px; line-height: 1.35; }
.farm-selection[hidden] { display: none; }
.farm-actions { display: flex; justify-content: center; gap: 10px; }
.farm-actions .window-back-button { flex: 0 1 150px; width: auto; margin: 0; }
.farm-sheet .farm-start {
  display: flex;
  flex: 0 1 150px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 8px 2px;
  border: 2px solid #103512;
  border-radius: 8px;
  background: linear-gradient(#5cbd5f, #2f7d38);
  box-shadow: 0 3px 0 #15351a;
  color: #fff;
  font: 900 11px/1 var(--font-rounded);
  text-transform: uppercase;
  cursor: pointer;
}
.farm-sheet .farm-start:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #15351a; }
.farm-sheet .farm-start:disabled { opacity: .45; cursor: default; }
.farm-empty { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.6; }
@media (max-height: 480px) {
  .farm-sheet { height: calc(100dvh - 16px); }
  .farm-header { padding-top: 10px; }
  .farm-map { margin-bottom: 4px; }
  .farm-sheet .farm-enemy { min-height: 48px; padding: 6px 10px; }
}
/* The Auto Farm window itself: black surfaces, green only where something is
 * on (the picked mode, Move On, a ready status). It sizes to what it
 * holds; the body scrolls between the banner and the footer when it must. */
#autoFarmSheet {
  --window-surface: #0c0c0c;
  --muted: #bdbdbd;
  --farm-line: rgba(255,255,255,.13);
  --farm-fill: #161616;
  height: fit-content;
  max-height: min(600px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px));
}
#autoFarmSheet [hidden] { display: none !important; }
.farm-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 2px 14px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}
.farm-body::-webkit-scrollbar { display: none; }
.farm-body > * { flex-shrink: 0; }
/* "?" in the banner's corner opens a page saying what each control does: just the mark, like the old minimap one. */
#autoFarmSheet .farm-header { position: relative; }
#autoFarmSheet .farm-help-toggle {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0;
  border: 0; background: none; box-shadow: none; color: #fff; font: 900 20px/1 var(--font-rounded); cursor: pointer;
  -webkit-text-stroke: 0; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}
#autoFarmSheet .farm-help-toggle[aria-expanded="true"] { color: var(--green); }
#autoFarmSheet .farm-help-toggle:active { transform: scale(.94); }
.farm-help { flex: 1 1 auto; min-height: 0; padding: 4px 16px 8px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; }
.farm-help::-webkit-scrollbar { display: none; }
.farm-help-list { display: grid; gap: 3px; margin: 0; }
.farm-help-list dt { margin-top: 7px; color: #fff; font-size: 14px; }
.farm-help-list dt:first-child { margin-top: 0; }
.farm-help-list dd { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; -webkit-text-stroke: 0; text-shadow: none; }
/* One slider per stat the map pays: its share of the farming time, 0% to 200%. They rest while on Auto. */
.farm-weights { display: grid; gap: 2px; }
.farm-weights.is-auto .farm-weight { opacity: .5; }
.farm-weight { display: grid; grid-template-columns: 96px minmax(0, 1fr) 44px auto; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
/* Aggro beside each slider (auto-farm-panel.ts): a small slide switch, and the count on the Stats heading. */
.farm-weight .farm-aggro-switch { --pill-w: 40px; --pill-h: 24px; --knob: 18px; }
.farm-weight .farm-aggro-switch[hidden] { display: none; }
/* On but waiting its turn (Aggro pulls only so many at once): amber, not green. */
.farm-weight .farm-aggro-switch.is-waiting[aria-checked="true"] { background: #e0a53a; }
.farm-stats-heading { display: flex; align-items: center; justify-content: space-between; }
.farm-aggro-count { color: #c9ced6; font-size: 13px; font-weight: 800; }
.farm-aggro-count[hidden] { display: none; }
.farm-weight-name { display: grid; gap: 1px; min-width: 0; }
/* Off · Farm · Aggro beside each stat (0.901.64, in place of its slider). */
.farm-weight.farm-mode-row, #autoFarmSheet.farm-card .farm-weight.farm-mode-row { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.farm-mode-row.is-off .farm-weight-label { color: var(--muted); }
.farm-mode-row .farm-mode button[hidden] { display: none; }
:is(.farm-sheet) .farm-mode-row .farm-mode button.is-waiting[aria-checked="true"] { color: #e0a53a; box-shadow: inset 0 -2px #e0a53a; }
.farm-weight-label { overflow: hidden; color: var(--farm-stat-color, #fff); font-size: 14px; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
.farm-weight-sub { overflow: hidden; color: #e8e8e8; font-size: 13px; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; -webkit-text-stroke: 0; text-shadow: none; }
.farm-weight output { color: #fff; font-size: 14px; text-align: right; -webkit-text-stroke: 0; text-shadow: none; }
.farm-weight.is-zero output, .farm-weight.is-zero .farm-weight-label { color: var(--muted); }
.farm-weight input[type="range"] {
  --farm-track: linear-gradient(to right, var(--farm-stat-color) var(--farm-weight-at, 50%), #333 var(--farm-weight-at, 50%));
  width: 100%; min-width: 0; height: 36px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.farm-weight input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--farm-track); }
.farm-weight input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--farm-track); }
.farm-weight input[type="range"]::-webkit-slider-thumb {
  box-sizing: border-box; width: 22px; height: 22px; margin-top: -8px; border: 3px solid var(--ui-outline); border-radius: 50%; background: #f2f2f2;
  appearance: none; -webkit-appearance: none;
}
.farm-weight input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 22px; height: 22px; border: 3px solid var(--ui-outline); border-radius: 50%; background: #f2f2f2; }
.farm-weight input[type="range"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* Move At and Fight At, each under its switch: gold, resting with the switch off. */
.farm-power { --farm-stat-color: #ffcf7a; padding: 0 2px; }
.farm-power.is-off { opacity: .6; }
/* Move On: the boss, then the next map; what it will do next under the name. */
.farm-sheet .farm-switch {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 50px; padding: 6px 12px;
  border: 2px solid transparent; border-radius: 10px; background: var(--farm-fill); box-shadow: none;
  color: #fff; font: inherit; font-size: 14px; line-height: 1.15; text-align: left; cursor: pointer;
}
.farm-switch-copy { display: grid; flex: 1; gap: 2px; min-width: 0; }
.farm-boss-status { display: block; overflow: hidden; color: #ffcf7a; font-size: 13px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; -webkit-text-stroke: 0; text-shadow: none; }
.farm-boss-status:empty { display: none; }
.farm-boss-status.is-ready { color: #98efaa; }
.farm-boss-status.is-idle { color: #9a9a9a; }
.farm-knob { position: relative; flex-shrink: 0; width: 34px; height: 20px; border-radius: 10px; background: #000; box-shadow: inset 0 0 0 2px rgba(255,255,255,.2); }
.farm-knob::after { content: ""; position: absolute; top: 4px; left: 4px; width: 12px; height: 12px; border-radius: 50%; background: #8a8a8a; transition: transform .12s ease; }
.farm-sheet .farm-switch[aria-checked="true"] { border-color: var(--green); }
.farm-switch[aria-checked="true"] .farm-knob { background: #2f7d38; box-shadow: none; }
.farm-switch[aria-checked="true"] .farm-knob::after { transform: translateX(14px); background: #fff; }
/* Auto Mine in the Town: what it is doing over its ore switches; a shut vein's switch is locked. */
.farm-mine-status { margin: 0; padding: 2px 0; color: #fff; font-size: 14px; line-height: 1.3; text-align: center; white-space: normal; }
.farm-mine-status.is-idle { color: var(--muted); }
.farm-mine-ores { display: grid; gap: 8px; }
.farm-sheet .farm-switch:disabled { opacity: .55; cursor: default; }
/* More: Push, Pull and Target, folded away until wanted. */
.farm-more { display: grid; gap: 8px; padding: 0 2px; }
.farm-setting { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.farm-setting-label { flex: 1 0 auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.farm-segment { display: flex; flex: 0 1 auto; margin-left: auto; overflow: hidden; border: 0; border-radius: 8px; background: #0a0b0c; }
:is(.farm-sheet, .aggro-pick-window) .farm-segment button {
  min-width: 52px; height: 34px; padding: 0 10px; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--muted); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer;
}
:is(.farm-sheet, .aggro-pick-window) .farm-segment button + button { border-left: 1px solid var(--farm-line); }
:is(.farm-sheet, .aggro-pick-window) .farm-segment button[aria-checked="true"] { background: #262626; color: #fff; box-shadow: inset 0 -2px var(--green); }
.farm-segment.is-off { opacity: .45; }
.farm-sheet .farm-segment button:disabled { cursor: default; }
.farm-segment.is-off button[aria-checked="true"] { box-shadow: inset 0 -2px var(--muted); }
/* During an Aggro run the window opens the picker from this row; display: flex above would override hidden. */
.farm-aggro-row[hidden] { display: none; }
/* The Aggro picker's Target row: the same segment as the window's, which it mirrors. */
.aggro-pick-target { --muted: #bdbdbd; --farm-line: rgba(255,255,255,.13); font: 900 13px/1.35 var(--font-rounded); }
.aggro-pick-window .farm-segment button { margin: 0; }
.aggro-pick-window .farm-segment button:active { transform: none; }
.aggro-pick-window .farm-segment button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
#autoFarmSheet .farm-start { text-transform: none; font-size: 14px; }
#autoFarmSheet .window-back-button { font-size: 14px; }
#autoFarmSheet .farm-selection { font-size: 13px; }
@media (max-height: 480px) {
  /* Short landscape phones: wider, the sliders in two columns, a little tighter. */
  #autoFarmSheet { width: min(680px, calc(100vw - 24px)); height: fit-content; max-height: calc(100dvh - 16px); }
  #autoFarmSheet .farm-header { padding-top: 8px; }
  #autoFarmSheet .farm-body { gap: 6px; }
  .farm-weights { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); column-gap: 18px; }
  .farm-weight { min-height: 40px; }
  .farm-sheet .farm-switch { min-height: 44px; padding: 4px 12px; }
  .farm-sheet .farm-segment button { height: 32px; }
}
/* Auto Farm lives alongside the quest/stat trackers, outside the modal layer. */
#autoFarmSheet.farm-card {
  position: fixed;
  /* Centred above mini chat, where the old Auto Farm button sat: on a phone the corners hold the joystick and skills. */
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--toolbar-height) + var(--mini-chat-height) + 12px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  width: min(320px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  height: auto;
  max-height: min(600px, calc(100dvh - 16px));
  margin: 0;
  border: var(--hud-border) solid var(--hud-frame);
  border-radius: var(--hud-radius-small);
  background: var(--hud-surface);
  box-shadow: var(--ui-shadow); outline: var(--hud-seam); outline-offset: -1px;
  font: 700 13px/1.3 "Wildstat Chat", sans-serif;
  pointer-events: auto;
}
#autoFarmSheet.farm-card, #autoFarmSheet.farm-card * {
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: none;
}
#autoFarmSheet.farm-card[hidden], #hud.chat-large #autoFarmSheet { display: none; }
#chatPanel[hidden] ~ #autoFarmSheet { bottom: calc(var(--toolbar-height) + 12px); }
#autoFarmSheet.farm-card.is-world-gesture, #autoFarmSheet.farm-card.is-world-gesture * { pointer-events: none; }
#autoFarmSheet.farm-card .farm-header { display: flex; align-items: center; padding: 0; }
#autoFarmSheet .farm-card-handle {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#autoFarmSheet .farm-card-handle:active { transform: none; cursor: grabbing; }
#autoFarmSheet .farm-swords-icon { width: 18px; height: 18px; }
#autoFarmSheet .farm-badge { color: var(--muted); font-size: 13px; }
#autoFarmSheet.is-farming .farm-badge { color: #98efaa; }
#autoFarmSheet .farm-card-caret { font-size: 13px; }
#autoFarmSheet.farm-card .farm-help-toggle {
  position: static;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  font: inherit;
  font-weight: 900;
}
#autoFarmSheet .farm-card-content { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--farm-line); }
#autoFarmSheet.farm-card .farm-body { gap: 5px; padding: 8px; }
#autoFarmSheet.farm-card .farm-weights { grid-template-columns: 1fr; }
#autoFarmSheet.farm-card .farm-weight { grid-template-columns: 96px minmax(0, 1fr) 40px auto; gap: 6px; min-height: 34px; }
#autoFarmSheet.farm-card .farm-weight-label, #autoFarmSheet.farm-card .farm-weight output { font-size: 13px; }
#autoFarmSheet.farm-card .farm-weight-sub, #autoFarmSheet.farm-card .farm-boss-status { font-size: 13px; }
#autoFarmSheet.farm-card .farm-switch { min-height: 40px; padding: 5px 8px; border-width: 1px; border-radius: 6px; font-size: 13px; }
#autoFarmSheet.farm-card .farm-setting-label { font-size: 13px; }
#autoFarmSheet.farm-card .farm-segment { border-width: 1px; border-radius: 6px; }
#autoFarmSheet.farm-card .farm-segment button { min-width: 40px; height: 30px; padding: 0 6px; font-size: 13px; }
#autoFarmSheet.farm-card .farm-footer { padding: 6px 8px 8px; }
#autoFarmSheet.farm-card .farm-selection { font-size: 13px; }
#autoFarmSheet.farm-card .farm-actions { gap: 6px; }
#autoFarmSheet.farm-card .farm-actions button { height: 32px; min-height: 32px; font: inherit; font-size: 13px; border-width: 1px; box-shadow: none; text-transform: none; }
#autoFarmSheet.farm-card .farm-help { padding: 8px; }
#autoFarmSheet.farm-card .farm-help-list dt { font-size: 14px; }
#autoFarmSheet.farm-card .farm-help-list dd { font-size: 13px; }
/* Collapsed: the quest tracker's header size and type, a single label. */
#autoFarmSheet.farm-card.is-collapsed { width: max-content; min-width: 0; font: 700 11px/1.25 "Wildstat Chat", sans-serif; }
/* Minimized, it stands as tall as the gem and mail row, border and all. */
#autoFarmSheet.farm-card.is-collapsed { box-sizing: border-box; height: 30px; }
#autoFarmSheet.farm-card.is-collapsed .farm-header { height: 100%; }
#autoFarmSheet.farm-card.is-collapsed .farm-card-handle { box-sizing: border-box; height: 100%; min-height: 0; padding: 0 8px; font-weight: 700; }
#autoFarmSheet.farm-card.is-collapsed .farm-badge { color: #fff; font-size: 11px; }
#autoFarmSheet.farm-card.is-collapsed.is-farming .farm-badge { color: #98efaa; }
#autoFarmSheet.farm-card.is-collapsed .farm-card-caret { font-size: 11px; }
/* Opened: the ordinary Auto Farm window, centred and fixed, over a backdrop that closes it. */
.farm-window-backdrop { position: fixed; inset: 0; z-index: 19; background: #0008; pointer-events: auto; }
.farm-window-backdrop[hidden] { display: none; }
#autoFarmSheet.is-window {
  /* The HUD lets touches through to the world; the window takes its own, or they fell through to the backdrop and closed it. */
  pointer-events: auto;
  position: fixed; left: 50% !important; top: 50% !important; right: auto !important; bottom: auto !important; z-index: 20;
  display: flex; flex-direction: column; transform: translate(-50%, -50%) !important;
  height: fit-content; max-height: min(600px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px));
}
#autoFarmSheet.is-window .farm-header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 12px 4px; }
#autoFarmSheet.is-window .farm-card-handle {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 0; background: none; box-shadow: none; color: #fff;
  font: inherit; font-size: 17px; cursor: pointer;
}
#autoFarmSheet.is-window .farm-card-handle:active { transform: none; }
#autoFarmSheet.is-window .farm-card-handle { flex: 0 1 auto; }
#autoFarmSheet.is-window .farm-help-toggle { position: absolute; top: 8px; right: 8px; }
#autoFarmSheet.is-window.is-farming .farm-badge { color: #98efaa; }
/* The body scrolls between the fixed header and footer when the window is taller than the screen. */
#autoFarmSheet.is-window .farm-card-content { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
#autoFarmSheet.is-window .farm-body, #autoFarmSheet.is-window .farm-help { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; }
#autoFarmSheet.is-window .farm-body::-webkit-scrollbar, #autoFarmSheet.is-window .farm-help::-webkit-scrollbar { display: none; }
#autoFarmSheet.is-window .farm-footer { flex-shrink: 0; }
#autoFarmSheet .farm-help-toggle[hidden] { display: none; }
@media (any-pointer: coarse) {
  #autoFarmSheet.farm-card:not(.is-collapsed) .farm-card-handle,
  #autoFarmSheet.farm-card .farm-switch,
  #autoFarmSheet.farm-card .farm-actions button { min-height: 44px; }
  #autoFarmSheet.farm-card .farm-help-toggle { width: 44px; height: 44px; flex-basis: 44px; }
  #autoFarmSheet.farm-card .farm-weight, #autoFarmSheet.farm-card .farm-weight input { min-height: 44px; }
  #autoFarmSheet.farm-card .farm-segment button { height: 44px; }
}
/* Home's travel portal reuses this window frame and its rows. It sizes to its
 * list, so a new player's two maps do not sit in a mostly empty window. */
.farm-sheet.travel-sheet {
  height: fit-content;
  max-height: min(600px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px));
}
.travel-sheet .farm-enemy-mark { color: #fff; font-size: 16px; }
.travel-sheet .farm-reward { color: var(--muted); }
.travel-sheet .is-departure .farm-reward { color: #ffcf7a; }
.farm-sheet .travel-map.is-locked { opacity: .5; cursor: default; }
.travel-sheet .is-locked .farm-reward { white-space: normal; }
.travel-sheet .is-locked .farm-check { visibility: hidden; }
.travel-endless { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.travel-endless .travel-map { flex: 1 1 auto; min-width: 0; }
.farm-sheet .travel-step {
  flex: 0 0 34px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: #ffffff06;
  box-shadow: none;
  color: #fff;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}
.farm-sheet .travel-step:disabled { opacity: .35; cursor: default; }
.travel-stage {
  flex: 0 0 52px;
  box-sizing: border-box;
  width: 52px;
  min-width: 0;
  padding: 0 4px;
  border: 2px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: #0006;
  color: #fff;
  font: inherit;
  font-size: 14px;
  text-align: center;
  -moz-appearance: textfield;
}
.travel-stage::-webkit-inner-spin-button, .travel-stage::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-height: 480px) {
  .farm-sheet.travel-sheet { height: fit-content; max-height: calc(100dvh - 16px); }
}
/* Duplicate equipment: Keep or Ignore. The Auto Farm window's frame, text and
 * buttons, as a small card that does not pause the game: it sits under the top
 * HUD, clear of the player at the centre, and never takes the whole screen. */
.equipment-offer {
  position: fixed;
  top: calc(var(--hud-safe-top) + var(--player-hud-visual-height) + 42px);
  left: 50%;
  z-index: 14;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--hud-safe-top) - var(--player-hud-visual-height) - var(--window-bottom-inset) - 54px);
  padding: 12px 12px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 14px;
  background: var(--window-surface);
  color: var(--text);
  box-shadow: 0 20px 56px rgba(0,0,0,.72);
  font: 900 var(--font-readable-body)/1.35 var(--font-rounded);
  -webkit-text-stroke: var(--text-outline-width) #000;
  paint-order: stroke fill;
  text-shadow: var(--text-shadow);
  transform: translateX(-50%);
  pointer-events: auto;
  animation: equipment-offer-enter .22s cubic-bezier(.2,.9,.24,1.2);
}
.equipment-offer[hidden] { display: none; }
.equipment-offer:focus { outline: none; }
.equipment-offer button { margin: 0; }
.equipment-offer button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.equipment-offer-close {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: 900 20px/1 var(--font-rounded);
  cursor: pointer;
}
.equipment-offer-header { display: flex; align-items: center; gap: 10px; min-width: 0; padding-right: 26px; }
.equipment-offer-art {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #0006;
}
.equipment-offer-art > * { width: 36px; height: 36px; }
.equipment-offer-heading { display: grid; gap: 2px; min-width: 0; }
.equipment-offer-name { margin: 0; overflow: hidden; font: inherit; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.equipment-offer-note { color: #ffcf7a; font-size: 12px; }
.equipment-offer-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.equipment-offer-compare[hidden] { display: none; }
.equipment-offer-roll {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  border: 2px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: #ffffff06;
  font-size: 12px;
}
.equipment-offer-roll strong { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.equipment-offer-roll.is-new { border-color: var(--green); background: rgba(105,229,111,.08); }
.equipment-offer-lines { display: grid; gap: 1px; }
.equipment-offer-timer { margin: 0; color: var(--muted); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.equipment-offer-actions { display: flex; justify-content: center; gap: 10px; }
.equipment-offer-actions .window-back-button { flex: 0 1 140px; width: auto; margin: 0; }
.equipment-offer .equipment-offer-keep {
  display: flex;
  flex: 0 1 140px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 8px 2px;
  border: 2px solid #103512;
  border-radius: 8px;
  background: linear-gradient(#5cbd5f, #2f7d38);
  box-shadow: 0 3px 0 #15351a;
  color: #fff;
  font: 900 11px/1 var(--font-rounded);
  -webkit-text-stroke: var(--text-outline-width) #000;
  paint-order: stroke fill;
  text-shadow: var(--text-shadow);
  cursor: pointer;
}
.equipment-offer .equipment-offer-keep:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #15351a; }
.equipment-offer button:disabled { opacity: .45; cursor: default; }
@keyframes equipment-offer-enter {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.96); }
  to { opacity: 1; transform: translateX(-50%); }
}
/* Landscape phones: beside the top HUD rather than under it, a little tighter. */
@media (max-height: 480px) {
  .equipment-offer { top: var(--hud-safe-top); gap: 6px; padding: 8px 10px; max-height: calc(100dvh - var(--hud-safe-top) - var(--window-bottom-inset) - 8px); }
  .equipment-offer-art { flex-basis: 36px; width: 36px; height: 36px; }
  .equipment-offer-art > * { width: 30px; height: 30px; }
  .equipment-offer .equipment-offer-keep, .equipment-offer-actions .window-back-button { height: 38px; min-height: 38px; }
}
/* The way back to offers closed for later: a count on the Inventory button and a line in the bag. */
.equipment-offer-badge {
  position: absolute;
  top: 3px;
  right: calc(50% - 26px);
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #d8323c;
  color: #fff;
  font: 900 10px/1 var(--chat-font);
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 0;
  text-shadow: none;
  pointer-events: none;
}
.equipment-offer-badge[hidden] { display: none; }
.equipment-offer-review {
  width: 100%;
  min-height: 34px;
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 2px solid #c9ab64;
  border-radius: 8px;
  background: rgba(201,171,100,.12);
  box-shadow: none;
  color: #ffcf7a;
  font: 900 12px/1.3 var(--font-rounded);
  text-align: center;
  cursor: pointer;
}
.equipment-offer-review[hidden] { display: none; }
.equipment-offer-score { margin-top: 2px; color: #ff8872; font-weight: 700; }

/* Daily Quest board: today's three quests, then the guild's week and ranking. */
.farm-sheet.quest-sheet { height: fit-content; max-height: min(640px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px)); }
.quest-sheet .quest-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.quest-sheet .farm-footer { flex-shrink: 0; }
.quest-sheet .quest-list { margin: 0 14px 10px; }
.quest-sheet .quest-guild-hint { margin: 0 14px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.quest-sheet .quest-list { display: grid; gap: 8px; }
.quest-sheet .quest-row { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px; border: 2px solid transparent; border-radius: 10px; background: #1b1c1d; }
.quest-sheet .quest-row.is-done { border-color: var(--green); background: rgba(105,229,111,.08); }
/* The week's fifteen under the reset line, as tally marks: white until done, then green. */
.quest-sheet .quest-week { display: flex; justify-content: center; gap: 6px; margin: -2px 0 12px; }
.quest-sheet .quest-week-step { flex: none; width: 5px; height: 18px; border-radius: 3px; background: rgba(255,255,255,.85); }
.quest-sheet .quest-week-step.is-done { background: var(--green); }
/* The HUD tracker's switch, at the foot of the board. */
.quest-sheet .quest-tracker-setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 0; padding: 8px 10px; border: 2px solid transparent; border-radius: 10px; background: #1b1c1d; font-weight: 800; }
.quest-sheet .quest-tracker-setting[hidden] { display: none; }
.quest-sheet .quest-tracker-switch { flex: none; margin: 0; }
/* A quest a guildmate collected: no longer this player's to finish. */
.quest-sheet .quest-row.is-taken { opacity: .55; }
.quest-sheet .quest-check { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid rgba(255,255,255,.3); border-radius: 50%; color: transparent; font-size: 15px; -webkit-text-stroke: 0; text-shadow: none; }
.quest-sheet .is-done .quest-check { border-color: var(--green); background: var(--green); color: #fff; }
.quest-sheet .quest-copy { display: grid; flex: 1 1 auto; gap: 3px; min-width: 0; }
.quest-sheet .quest-where { color: var(--muted); font-size: 12px; }
.quest-sheet .quest-bar { display: block; height: 7px; overflow: hidden; border-radius: 4px; background: #00000055; }
.quest-sheet .quest-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f2c94c, #ffdf7e); }
.quest-sheet .is-done .quest-bar span { background: var(--green); }
.quest-sheet .quest-count { flex: 0 0 auto; color: #ffdf7e; font-size: 14px; }
.quest-sheet .is-done .quest-count { color: var(--green); }
/* Ox's Galaxy Shop: the board's rows, each with its piece, slot and price. */
.ox-shop-sheet .ox-shop-intro { margin: 0 14px 6px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.35; }
.ox-shop-sheet .ox-shop-balance { margin: 0 14px 10px; color: #c9b8ff; text-align: center; font-size: 15px; font-weight: 800; }
.ox-shop-sheet .ox-shop-art { flex: 0 0 52px; display: grid; place-items: center; width: 52px; height: 52px; }
.ox-shop-sheet .ox-shop-art .inventory-item-art { width: 48px; height: 44px; }
.ox-shop-sheet .quest-copy strong { font-size: 15px; }
.ox-shop-sheet .farm-start.ox-shop-buy { flex: 0 0 96px; height: 40px; min-height: 40px; font-size: 13px; text-transform: none; }
.ox-shop-sheet .is-owned { border-color: rgba(201,184,255,.5); }
/* The Smith's window (smith-window.ts): the chosen copy on top, its odds and cost, the gear to pick from below.
   Its sheets (and the schools' and the Card Seller's) take the neutral grey, as the Auto Farm sheet does. */
.smith-sheet { --muted: #bdbdbd; }
.smith-sheet .smith-intro { margin: 0 14px 8px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.35; }
.smith-sheet .smith-focus { display: grid; gap: 10px; margin: 0 14px 10px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.05); }
.smith-sheet .smith-empty { margin: 6px 0; color: var(--muted); text-align: center; font-size: 13px; }
.smith-sheet .smith-item { display: flex; align-items: center; gap: 12px; }
.smith-sheet .smith-art { flex: 0 0 56px; display: grid; place-items: center; width: 56px; height: 56px; }
.smith-sheet .smith-art .inventory-item-art { width: 52px; height: 48px; }
.smith-sheet .smith-copy { display: grid; gap: 3px; min-width: 0; }
.smith-sheet .smith-copy strong { font-size: 16px; }
.smith-sheet .smith-stat { color: #fff; font-size: 14px; font-weight: 800; }
.smith-sheet .smith-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.smith-sheet .smith-facts div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.smith-sheet .smith-facts dt { color: var(--muted); }
.smith-sheet .smith-facts dd { margin: 0; font-weight: 800; }
.smith-sheet .smith-facts .is-safe dd { color: var(--green); }
.smith-sheet .smith-facts .is-risky dd { color: #ffb070; }
/* The Smith's button is gold, the refine's own color, and button-sized, not the
   card's full width. Its text stays white with the black outline every button's text has: dark text under that
   outline read as black on black. */
.smith-sheet .farm-start.smith-refine { justify-self: center; min-width: 150px; height: 44px; min-height: 44px; padding: 0 18px 2px; border-color: #5a3c00; background: linear-gradient(#d4b052, #a27a22); box-shadow: 0 3px 0 #5a3c00; font-size: 15px; text-transform: none; }
.smith-sheet .farm-start.smith-refine:active:not(:disabled) { box-shadow: 0 1px 0 #5a3c00; }
.smith-sheet .smith-outcome { margin: 0; text-align: center; font-size: 14px; font-weight: 900; }
.smith-sheet .smith-outcome.is-good { color: #ffd75e; }
.smith-sheet .smith-outcome.is-bad { color: #ff9b91; }
.smith-sheet .smith-ores { margin: 0 14px 12px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.4; }
/* Where ore comes from: the Copper Hills, and the Smith's free pickaxe until it is taken. */
.smith-sheet .smith-mining { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin: 0 14px 12px; color: var(--muted); font-size: 13px; text-align: center; }
/* The gear filters as chips: the one shown white. */
.smith-sheet .smith-filters { display: flex; flex-wrap: nowrap; gap: 4px; margin: 0 14px 10px; }
.smith-sheet .smith-filters .inventory-filter { flex: 1 1 auto; min-height: 32px; padding: 0 6px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: #141414; color: #c7c7c7; font: 800 13px/1 var(--font-rounded); }
.smith-sheet .smith-filters .inventory-filter[aria-pressed="true"] { border-color: #fff; background: #fff; color: #111; text-shadow: none; -webkit-text-stroke: 0; }
.smith-sheet .smith-mining[hidden], .smith-sheet .farm-start[hidden] { display: none; }
/* A card's effects, as the Card Seller lists them. */
.smith-sheet .smith-card-effects { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; text-align: center; font-size: 14px; font-weight: 800; }
.smith-sheet .smith-card-effects .is-cost { color: #ff9b91; }
/* The Smith's gear for gold: the gold held, then a compact row per line with its next grade, price and Buy. */
.smith-sheet .smith-shop { display: grid; gap: 10px; margin: 0 14px 12px; }
.smith-sheet .smith-shop[hidden] { display: none; }
.smith-sheet .smith-shop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.smith-sheet .smith-shop-head h3 { margin: 0 2px; color: #fff; font: 900 16px/20px var(--font-rounded); }
.smith-sheet .smith-coin { flex: 0 0 auto; width: 16px; height: 16px; }
.smith-sheet .smith-gold { display: inline-flex; align-items: center; gap: 5px; color: #ffd75e; font-size: 15px; font-weight: 900; }
.smith-sheet .smith-gold[hidden] { display: none; }
.smith-sheet .smith-shop-rows { display: grid; gap: 8px; }
/* A row: art beside the name (on its own line, never cut), grade and kind, stat and needs; under them, the one way
   its tab gets it (Buy for gold, Craft from materials), its terms on the left and a short button on the right. */
.smith-sheet .smith-shop-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 12px; border: 0; border-radius: 12px; background: #1b1c1d; }
.smith-sheet .smith-shop-art { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px; background: #0d0d0d; }
.smith-sheet .smith-shop-art .inventory-item-art { width: 48px; height: 44px; }
.smith-sheet .smith-shop-copy { display: grid; justify-items: start; gap: 2px; min-width: 0; }
.smith-sheet .smith-shop-copy strong { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.smith-sheet .smith-shop-grade, .smith-sheet .smith-shop-stat { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.smith-sheet .smith-shop-stat { color: #fff; font-size: 14px; font-weight: 800; }
/* An arrow's effect is its whole point: it wraps rather than cut. */
.smith-sheet .smith-shop-row.is-arrow .smith-shop-stat { white-space: normal; }
/* What a piece changes against what is worn, as a pill: better white, worse muted. */
.smith-sheet .smith-compare { margin: 3px 0 1px; padding: 4px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: #1d1d1d; color: #fff; font: 900 13px/16px var(--font-rounded); }
.smith-sheet .smith-compare.is-better { border-color: rgba(255,255,255,.6); }
.smith-sheet .smith-compare.is-worse, .smith-sheet .smith-compare.is-same { color: var(--muted); font-weight: 800; }
.smith-sheet .smith-shop-deal { grid-column: 1 / -1; display: grid; gap: 4px; }
.smith-sheet .smith-shop-deal:empty { display: none; }
.smith-sheet .smith-offer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.smith-sheet .smith-offer-terms { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; }
.smith-sheet .smith-shop-price { display: inline-flex; align-items: center; gap: 4px; color: #ffd75e; font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.smith-sheet .smith-shop-price.is-short { opacity: .6; }
.smith-sheet .farm-start.smith-refine.smith-shop-buy { flex: none; min-width: 96px; max-width: 132px; height: auto; min-height: 40px; margin: 0; padding: 4px 12px 6px; font-size: 14px; line-height: 1.15; white-space: nowrap; }
.smith-sheet .farm-start.smith-refine.smith-shop-buy:disabled { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); box-shadow: none; color: var(--muted); }
/* The Starter Chest's window (starter-chest-window.ts): the Smith's rows, with a plain white Pick in place of his gold buttons. */
.starter-chest-window .farm-start.smith-refine.starter-chest-pick { border-color: #6b6b6b; background: #fff; box-shadow: 0 3px 0 #6b6b6b; color: #111; text-shadow: none; -webkit-text-stroke: 0; }
.starter-chest-window .farm-start.smith-refine.starter-chest-pick:active:not(:disabled) { box-shadow: 0 1px 0 #6b6b6b; }
/* A tool's button can name its skill ("Need Lv 3,000 Woodcutting"): it wraps rather than overflow. */
.smith-sheet .tool-row .farm-start.smith-refine.smith-shop-buy { white-space: normal; }
/* The Smith's crafting card (craft-section.ts): Smithing, Fletching and Enchanting side by side, each its level and a
   thin bar, at the top of the Craft tab. */
.smith-sheet .smith-shop .craft-section { margin: 4px 0 0; }
.smith-sheet .craft-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 0; border-radius: 12px; background: #1b1c1d; }
.smith-sheet .craft-skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.smith-sheet .craft-skill { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.smith-sheet .craft-name { overflow: hidden; color: #fff; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.smith-sheet .craft-level { color: #fff; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.smith-sheet .craft-bar { display: block; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.smith-sheet .craft-bar > span { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width .2s; }
.smith-sheet .craft-points { color: rgba(255,255,255,.72); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.smith-sheet .craft-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
/* Needs and materials: what is still short stands out in white; what is met steps back. */
.smith-sheet .craft-needs { color: var(--muted); font-size: 13px; line-height: 1.3; }
.smith-sheet .craft-needs .is-met { color: var(--muted); font-weight: 600; }
.smith-sheet .craft-needs .is-unmet { color: #fff; font-weight: 900; }
.smith-sheet .craft-hint { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.smith-sheet .smith-shop-owned { color: var(--muted); font-size: 13px; font-weight: 800; }
.smith-sheet .craft-offer .smith-offer-terms, .smith-sheet .buy-offer .smith-offer-terms { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 4px; }
/* The grade stepper on a craft line: any open grade, thumb-sized steps. */
.smith-sheet .craft-grade { display: inline-flex; align-items: center; gap: 6px; }
.smith-sheet .craft-grade-step { flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.06); color: #fff; font-size: 18px; font-weight: 900; line-height: 1; }
.smith-sheet .craft-grade-step:disabled { opacity: .35; }
.smith-sheet .craft-grade-name { min-width: 64px; color: #fff; font-size: 14px; font-weight: 900; text-align: center; white-space: nowrap; }
.smith-sheet .craft-materials { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 0; padding: 0; list-style: none; }
.smith-sheet .craft-material { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.smith-sheet .craft-material.is-short { color: #fff; font-weight: 900; }
.smith-sheet .craft-material-icon { flex: none; width: 20px; height: 20px; background: center / contain no-repeat; }
/* A graded craft line: the grade, materials, then a full-width button naming the piece. */
.smith-sheet .smith-offer.craft-line { flex-direction: column; align-items: stretch; gap: 8px; }
.smith-sheet .craft-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.smith-sheet .craft-next { color: var(--muted); font-size: 13px; line-height: 1.3; }
.smith-sheet .farm-start.smith-refine.smith-shop-buy.craft-action { align-self: center; justify-self: center; width: auto; min-width: 150px; max-width: 100%; min-height: 44px; margin: 0 auto; padding: 0 18px 2px; font-size: 15px; white-space: normal; text-wrap: balance; }
/* The Smith's tabs as a pill toggle, as the Cards tab's: Buy, Craft, Refine, Upgrade. */
.smith-sheet .smith-views-bar { display: flex; justify-content: center; margin: 0 14px 12px; }
.smith-sheet .smith-views-bar[hidden], .smith-sheet .smith-view[hidden] { display: none; }
.smith-sheet .smith-views { display: inline-flex; gap: 0; padding: 3px; border: 0; border-radius: 999px; background: #0c0d0e; overflow: visible; }
.smith-sheet .smith-views .inventory-filter { position: relative; min-width: 86px; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; color: #b3b3b3; font: 900 14px/1 var(--font-rounded); letter-spacing: .02em; }
.smith-sheet .smith-views .inventory-filter[aria-pressed="true"] { background: #fff; color: #111; border-bottom: 0; text-shadow: none; -webkit-text-stroke: 0; }
/* Four tabs share the bar at phone width. */
.smith-sheet .smith-views .inventory-filter { min-width: 70px; padding: 0 12px; }
/* Slot Upgrades (slot-upgrades-controller.ts) on the Upgrade tab, under its heading: the old standalone window laid flat in the sheet, in its colors. */
.smith-sheet .slot-upgrades-content { width: 100%; margin: 0 auto; }
.smith-sheet .slot-upgrades-prompt { font-size: 15px; }
.smith-sheet .inventory-item.slot-upgrades-queue { border-color: rgba(255,255,255,.16); background: #141414; }
.smith-sheet .inventory-item.slot-upgrades-queue.is-active { background: #1f1f1f; }
.smith-sheet .inventory-item.slot-upgrades-queue.is-selected { border-color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.smith-sheet .slot-upgrades-queue .inventory-item-empty-mark { color: #bdbdbd; }
.smith-sheet .slot-upgrades-slot-name, .smith-sheet .slot-upgrades-stat-gain, .smith-sheet .slot-upgrades-stat-row strong,
.smith-sheet .slot-upgrades-queue-cost, .smith-sheet .slot-upgrades-picker-stat, .smith-sheet .slot-upgrades-picker-title strong { font-size: 13px; }
.smith-sheet .slot-upgrades-queue > .inventory-upgrade-level { font-size: 13px; line-height: 15px; }
.smith-sheet .slot-upgrades-stat-row span, .smith-sheet .slot-upgrades-picker-stat span:last-child { color: #fff; }
.smith-sheet .slot-upgrades-timer { color: #fff; font-size: 14px; }
.smith-sheet .slot-upgrades-action { width: auto; min-width: 150px; max-width: 100%; border-color: #5a3c00; background: linear-gradient(#d4b052, #a27a22); box-shadow: 0 3px 0 #5a3c00; font-size: 15px; }
.smith-sheet .slot-upgrades-action.is-cancel { border-color: #492020; background: linear-gradient(#cf6868, #953c3c); box-shadow: 0 3px 0 #431d1d; }
.smith-sheet .slot-upgrades-action.slot-upgrades-speed-up { border-color: #65354f; background: linear-gradient(#d86f9f, #a84573); box-shadow: 0 3px 0 #53243d; }
.smith-sheet .slot-upgrades-action:disabled { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); box-shadow: none; color: var(--muted); }
/* The slot list covers the whole window, as it did the old standalone window's. */
.smith-sheet .slot-upgrades-picker { position: fixed; z-index: 5; }
.smith-sheet .slot-upgrades-picker-sheet { background: var(--window-surface); }
.smith-sheet .slot-upgrades-picker-heading { font-size: 15px; letter-spacing: 0; }
.smith-sheet .slot-upgrades-picker-item { height: auto; min-height: 72px; border-color: rgba(255,255,255,.12); background: #141414; }
/* A section's heading in a view: its name, and a count on the right. */
.smith-sheet .smith-focus { border: 0; background: #1b1c1d; }
/* A station (the Smith and the gear sellers): the tabs and the picked piece stay put; only the grid under them scrolls. */
.farm-sheet.quest-sheet.station-sheet { height: min(640px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px)); }
.station-sheet .quest-body { display: flex; flex-direction: column; overflow: hidden; }
.station-sheet .smith-views-bar { flex: none; align-items: center; gap: 10px; }
.station-sheet.gear-seller-sheet .smith-views-bar { justify-content: space-between; }
.station-sheet .smith-view:not([hidden]) { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.station-sheet .smith-tools-view:not([hidden]) { display: block; overflow-y: auto; overscroll-behavior: contain; }
.station-sheet .station-detail { flex: 0 1 auto; min-height: 0; margin: 0 14px 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.station-sheet .station-detail.smith-focus { margin: 0 14px 8px; }
.station-sheet .station-detail .smith-empty { margin: 14px 0; }
.smith-auto-refine { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.smith-auto-refine label, .smith-auto-mode-field { display: grid; gap: 4px; color: var(--muted); font: 800 13px/1.35 var(--font-rounded); }
.smith-auto-refine :is(.smith-auto-mode > summary, input) { min-width: 0; width: 100%; box-sizing: border-box; height: 44px; padding: 0 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background-color: #111214; color: #f4f4f2; color-scheme: dark; font: 800 14px/1.35 var(--font-rounded); box-shadow: inset 0 2px 3px rgba(0,0,0,.3); }
.smith-auto-mode > summary { display: flex; align-items: center; list-style: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23f4f4f2' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 8px; cursor: pointer; }
.smith-auto-refine :is(.smith-auto-mode > summary, input):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.smith-auto-refine :is(.smith-auto-mode > summary, input):disabled { opacity: .55; cursor: default; }
.smith-refine-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; grid-column: 1 / -1; }
.smith-sheet .smith-refine-actions .farm-start { justify-self: stretch; width: 100%; min-width: 0; max-width: 100%; height: auto; min-height: 44px; padding: 4px 8px 6px; font-size: 14px; }
.smith-sheet .smith-refine-actions .smith-auto-start { border-color: #6b6b6b; background: linear-gradient(#3a3b3f, #232427); box-shadow: 0 3px 0 #111; }
.smith-sheet .smith-refine-actions .smith-auto-start.is-running { border-color: #492020; background: linear-gradient(#cf6868, #953c3c); box-shadow: 0 3px 0 #431d1d; }
.smith-sheet .smith-refine-actions .smith-auto-start:active:not(:disabled) { box-shadow: 0 1px 0 #111; }
.smith-sheet .smith-refine-actions .smith-auto-start.is-running:active { box-shadow: 0 1px 0 #431d1d; }
.smith-auto-status { grid-column: 1 / -1; font-size: 13px; color: var(--muted); text-align: center; }
.smith-auto-status:empty { display: none; }
.smith-auto-refine [hidden] { display: none; }
.smith-auto-mode > summary::-webkit-details-marker { display: none; }
.smith-auto-mode > summary[aria-disabled="true"] { opacity: .55; cursor: default; }
.smith-auto-mode { position: relative; }
.smith-auto-mode-list { position: absolute; z-index: 4; left: 0; right: 0; bottom: calc(100% + 4px); display: grid; gap: 3px; box-sizing: border-box; max-height: min(180px, 40dvh); overflow-y: auto; padding: 4px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: #111214; box-shadow: 0 3px 10px rgba(0,0,0,.5); }
.smith-auto-mode-list button { min-height: 40px; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #f4f4f2; font: 800 14px/1.35 var(--font-rounded); text-align: left; cursor: pointer; }
.smith-auto-mode-list button[aria-pressed="true"] { border-color: #fff; background: rgba(255,255,255,.12); }
.smith-auto-mode-list button:hover, .smith-auto-mode-list button:focus-visible { outline: none; border-color: #fff; background: rgba(255,255,255,.2); }
.smith-auto-refine > :is(label, .smith-auto-mode-field) { align-self: start; }
.station-sheet .station-scroll { display: flex; flex: 1 1 0; flex-direction: column; gap: 10px; min-height: 76px; padding: 2px 14px 12px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.station-sheet .station-scroll > .smith-filters, .station-sheet .station-scroll > .smith-ores, .station-sheet .station-scroll > .smith-intro, .station-sheet .station-scroll > .craft-section { margin: 0; }
.station-sheet .station-scroll > * { flex: none; }
.station-sheet .station-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.station-sheet .station-grid:empty { display: none; }
.station-sheet .station-grid > .inventory-item { color: #fff; }
.station-sheet .station-grid > .inventory-item.is-selected:not([data-grade]) { border-color: #fff; background: #262626; box-shadow: inset 0 0 0 1px #fff; }
.station-sheet .station-grid > .inventory-item.is-waiting > :not(.station-tile-badge) { opacity: .4; }
.station-sheet .station-tile-badge { position: absolute; right: 0; bottom: 3px; left: 0; color: #fff; font: 900 13px/1 var(--font-rounded); text-align: center; -webkit-text-stroke: 0; text-shadow: 0 1px 1px #000, 0 0 3px #000; pointer-events: none; }
.station-sheet .station-detail-row { padding: 10px 12px; }
/* A second grid's name in a tab: the Smith's Arrows under his gear. */
.station-sheet .station-subhead { margin: 2px 0 -4px; color: #fff; font: 900 15px/1.2 var(--font-rounded); }
.station-sheet .station-subhead[hidden] { display: none; }
/* A school's Mastery card, as the Smith's crafting card. */
.school-window .school-window-card { border-color: rgba(255,255,255,.12); border-radius: 12px; background: #141414; }
.school-window .school-window-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.1); }
.school-window .school-window-bar > span { background: #fff; }
/* The Card Seller's window (card-seller-window.ts), in the Smith's sheet: the countdown, then a row per card for sale. */
.card-seller-sheet .card-seller-timer { margin: 0 14px 10px; color: #fff; text-align: center; font-size: 15px; font-weight: 900; }
.card-seller-sheet .card-seller-offers { display: grid; gap: 10px; margin: 0 14px 10px; }
.card-seller-sheet .card-seller-offer { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border: 0; border-radius: 12px; background: #1c1d1e; }
.card-seller-sheet .card-seller-offer.is-elite { border-color: rgba(180,140,255,.35); }
.card-seller-sheet .card-seller-offer.is-boss { border-color: rgba(242,193,78,.45); }
.card-seller-sheet .card-seller-art { display: block; width: 76px; }
.card-seller-sheet .card-seller-art > .inventory-item.is-card { width: 76px; pointer-events: none; }
.card-seller-sheet .card-seller-copy { display: grid; gap: 4px; min-width: 0; }
.card-seller-sheet .card-seller-copy strong { font-size: 16px; }
.card-seller-sheet .card-seller-slot { color: var(--muted); font-size: 13px; font-weight: 800; }
.card-seller-sheet .card-seller-effects { margin: 2px 0; text-align: left; font-size: 13px; }
.card-seller-sheet .card-seller-price { display: grid; gap: 2px; margin: 2px 0 4px; padding: 0; list-style: none; font-size: 13px; font-weight: 800; }
.card-seller-sheet .card-seller-price li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.card-seller-sheet .card-seller-have { color: var(--muted); }
.card-seller-sheet .card-seller-price .is-short .card-seller-have { color: #ff9b91; }
.card-seller-sheet .farm-start.card-seller-buy { justify-self: start; min-width: 120px; height: 40px; min-height: 40px; font-size: 14px; }
.card-seller-sheet .smith-outcome { margin: 0 14px 10px; }
.card-seller-sheet .smith-outcome[hidden] { display: none; }
/* A refine on any item: a gold star and its level, where the slot tier keeps its green +N. */
.refine-badge { position: absolute; top: 2px; right: 4px; color: #ffd75e; font-size: 11px; font-weight: 900; text-shadow: 0 1px 0 #000, 0 0 3px rgba(0,0,0,.8); pointer-events: none; }
/* A worn slot hides its +N (the banner says the level), so the star takes that corner. A bag tile's tier sits
   over its top middle, so the star sits a line lower, clear of it. A profile slot keeps its +N in the corner,
   so the star sits under it. After a name, the star is just gold text. */
.equipment-slot > .refine-badge { top: 4px; right: 5px; z-index: 2; }
.inventory-item > .refine-badge { top: 15px; right: 5px; z-index: 2; }
.profile-equipment-slot > .refine-badge { top: 12px; right: 2px; font-size: 8px; }
.refine-stars { color: #ffd75e; }
/* An ore stack in the bag: its count in the bottom corner, outlined like the tier label over it. */
.inventory-item > .inventory-stack-count { position: absolute; right: 6px; bottom: 4px; z-index: 2; color: #fff; font: 900 13px/1 var(--font-rounded); -webkit-text-stroke: 3px #080b08; paint-order: stroke fill; pointer-events: none; }
/* The arrow kind nocked: outlined in white, a tick before its name (hud.ts oreTile). */
.inventory-item.is-ore.is-nocked { border-color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.inventory-item.is-ore.is-spent .inventory-item-art-wrap { opacity: .45; }
/* Six filter tabs (Ores the sixth) and the bag's buttons need about 375px: narrower, the tabs take a row of their own
   and the buttons sit under them on the right, rather than the last tab scrolling out of sight. */
@container (max-width: 380px) {
  .inventory-bag-toolbar { flex-wrap: wrap; row-gap: 4px; }
  .inventory-bag-toolbar > .inventory-filters { flex: 1 0 100%; justify-content: space-between; }
}
/* The Cards tab: each card held as a bag-style tile, its portrait framed in its rarity's colour. */
.inventory-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.inventory-content > [hidden] { display: none; }
.builds-tab { display: flex; flex-direction: column; gap: 10px; grid-column: 1; grid-row: 1 / span 2; min-width: 0; padding: 7px; }
.builds-tab[hidden] { display: none; }
.builds-tab-list { display: flex; flex-direction: column; gap: 4px; }
/* One compact row a build: name and gear on the left, its buttons on the right. */
.builds-tab-card { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 6px; background: #1c1d1e; }
.builds-tab-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.builds-tab-card strong { font-size: 14px; color: #fff; }
.builds-tab-head { display: flex; align-items: center; min-width: 0; }
.builds-tab-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.builds-tab-name { flex: 1; min-width: 0; height: 26px; padding: 0 8px; border: 1px solid #8a8a8a; border-radius: 4px; background: #141414; color: #fff; font: inherit; font-size: 14px; font-weight: 700; }
.builds-tab-detail { overflow: hidden; color: rgba(255,255,255,.72); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.builds-tab-actions { display: flex; flex: none; gap: 4px; }
.builds-tab-actions button { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid #555; border-radius: 6px; background: linear-gradient(#3a3a3a, #262626); color: #fff; font: inherit; font-size: 13px; font-weight: 700; }
.builds-tab-actions .builds-tab-rename { padding: 0; }
.builds-tab-actions .builds-tab-rename[hidden] { display: none; }
.builds-tab-actions .builds-tab-equip:not(:disabled) { border-color: var(--green, #5fd35a); }
.builds-tab-actions button:disabled { opacity: .5; }
/* A school's window, in its Town building: its Mastery level and bar, its passives and its five techniques. */
.school-window .school-window-card { display: flex; flex-direction: column; gap: 8px; margin: 0 14px 10px; padding: 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(255,255,255,.04); }
.school-window .school-window-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.school-window .school-window-head strong { min-width: 0; overflow: hidden; color: #fff; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.school-window .school-window-level { flex: none; margin-left: auto; color: #fff; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.school-window .school-window-bar { display: block; height: 8px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.14); }
.school-window .school-window-bar > span { display: block; height: 100%; border-radius: inherit; background: #e6e6e6; transition: width .2s; }
.school-window .school-window-points { color: rgba(255,255,255,.72); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.school-window .school-window-passives { display: grid; gap: 8px; margin: 0 14px 12px; }
.school-window .school-window-passives > div { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(255,255,255,.04); }
.school-window .school-window-passives dt { color: #fff; font-size: 14px; font-weight: 800; }
.school-window .school-window-passives dd { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin: 0; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.35; }
.school-window .school-window-now { color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.school-window .school-window-subhead { margin: 0 14px 8px; color: #fff; font-size: 15px; }
.school-window .school-window-techniques { display: grid; gap: 8px; margin: 0 14px 12px; padding: 0; list-style: none; }
.school-window .school-window-technique { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; background: rgba(255,255,255,.06); }
.school-window .school-window-technique.is-locked { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.02); opacity: .6; }
.school-window .school-window-technique-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.school-window .school-window-technique-head strong { min-width: 0; color: #fff; font-size: 14px; }
.school-window .school-window-technique-level { flex: none; margin-left: auto; color: rgba(255,255,255,.72); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.school-window .school-window-technique p { margin: 0; color: rgba(255,255,255,.82); font-size: 13px; line-height: 1.35; }
.school-window .school-window-technique-status { color: #fff; font-size: 13px; font-weight: 800; }
.school-window .is-locked .school-window-technique-status { color: rgba(255,255,255,.72); font-weight: 700; }
.cards-tab { display: grid; grid-column: 1; grid-row: 1 / span 2; align-content: start; gap: 6px; container-type: inline-size; min-width: 0; padding: 0 7px 7px; }
.cards-tab-count { display: block; margin: 0 auto 4px; }
.cards-search { box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px; background: #111; color: var(--text, #fff); font: inherit; }
.cards-search:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cards-search-status { margin: 0; color: #b3b3b3; font-size: 12px; }
.cards-tab .inventory-item[hidden], .cards-zone[hidden], .cards-search-status[hidden] { display: none; }
/* Active cards, at the top above the zones: a row per type, four slots each; empty is dashed, locked is dim. */
.cards-active-row { display: grid; gap: 3px; }
.cards-slot-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cards-slot { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; min-height: 48px; padding: 3px 2px; border: 2px dashed rgba(255,255,255,.25); border-radius: 8px; background: #161616; color: #b3b3b3; font: 800 13px/15px var(--font-rounded); cursor: pointer; }
.cards-slot.is-filled { border-style: solid; border-color: #8f9aa3; color: #fff; }
.cards-slot.is-elite { border-color: #b48cff; }
.cards-slot.is-boss { border-color: #f2c14e; }
.cards-slot.is-waiting { opacity: .55; }
.cards-slot.is-locked { border-style: solid; border-color: rgba(255,255,255,.08); background: #0f0f0f; opacity: .7; cursor: default; }
.cards-slot-art { width: 24px; height: 30px; background: center / cover no-repeat; border-radius: 4px; }
.cards-slot-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cards-lock-note { margin: 0; color: #b3b3b3; font: 800 13px/16px var(--font-rounded); }
/* A zone opens and closes from its header; open, a row per card with its odds. */
.cards-zones { display: grid; gap: 6px; }
.cards-zone { border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: #111; overflow: hidden; }
.cards-zone-header { margin: 0; box-shadow: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; background: #161616; color: #fff; text-align: left; cursor: pointer; }
.cards-zone-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 900 15px/18px var(--font-rounded); }
.cards-zone-count { color: #b3b3b3; font: 800 13px/16px var(--font-rounded); white-space: nowrap; }
.cards-zone-chevron::before { content: "▸"; display: inline-block; color: #d0d0d0; transition: transform .15s; }
.cards-zone.is-open .cards-zone-chevron::before { transform: rotate(90deg); }
/* The Cards tab's two views: Equip (pick a type, its slots, a card, the cards of that type) and Cards (tiles by zone). */
.cards-views-bar { display: flex; justify-content: center; margin: -4px 0 6px; }
.cards-views-bar .cards-views { display: inline-flex; gap: 0; padding: 3px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: #0d0d0d; overflow: visible; }
.cards-views-bar .inventory-filter { min-width: 96px; min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; color: #b3b3b3; font: 900 14px/1 var(--font-rounded); letter-spacing: .02em; }
.cards-views-bar .inventory-filter[aria-pressed="true"] { background: #fff; color: #111; border-bottom: 0; }
.cards-collection, .cards-equip { display: grid; gap: 12px; }
.cards-collection[hidden], .cards-equip[hidden] { display: none; }
.cards-collection { gap: 6px; }
.cards-progress { display: block; width: min(220px, 70%); height: 4px; margin: -2px auto 2px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.cards-progress > span { display: block; height: 100%; border-radius: inherit; background: #fff; }
.cards-zone-grid { padding: 6px; }
.cards-zone-grid[hidden] { display: none; }
.inventory-item.is-card.is-equipped { border-color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }

/* The loadout: Weapon, Helmet and Armor, each with the cards in its slots. */
.cards-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cards-type { display: grid; justify-items: center; gap: 6px; min-width: 0; margin: 0; padding: 10px 6px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: #141414; box-shadow: none; color: #fff; cursor: pointer; }
.cards-type[aria-pressed="true"] { border-color: #fff; background: #1f1f1f; box-shadow: inset 0 0 0 1px #fff; }
.cards-type-name { font: 900 15px/18px var(--font-rounded); }
.cards-type-used { color: #b3b3b3; font: 800 13px/16px var(--font-rounded); }
.cards-type-strip { display: flex; justify-content: center; gap: 4px; min-height: 30px; }
.cards-type-mini { width: 24px; height: 30px; border: 1px solid #8f9aa3; border-radius: 4px; background: center / cover no-repeat #0d0d0d; }
.cards-type-mini.is-elite { border-color: #b48cff; }
.cards-type-mini.is-boss { border-color: #f2c14e; }
.cards-type-mini.is-empty { border: 1px dashed rgba(255,255,255,.3); background: transparent; }

/* A section's heading: name on the left, its count on the right. */
.cards-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 2px 6px; }
.cards-section-head strong { color: #fff; font: 900 15px/18px var(--font-rounded); }
.cards-section-head span { color: #b3b3b3; font: 800 13px/16px var(--font-rounded); }
.cards-equip .cards-slot-row { gap: 8px; }
.cards-equip .cards-slot { aspect-ratio: 3 / 4; min-height: 0; gap: 4px; padding: 6px 4px; border-radius: 10px; font-size: 13px; }
.cards-equip .cards-slot-art { width: 72%; height: auto; aspect-ratio: 4 / 5; border-radius: 6px; }
.cards-equip .cards-slot.is-empty::before { content: "+"; color: #d0d0d0; font: 900 26px/1 var(--font-rounded); }
.cards-equip .cards-slot.is-empty { grid-template-rows: auto auto; align-content: center; }
.cards-equip .cards-slot.is-locked { grid-template-rows: auto; align-content: center; }
.cards-equip .cards-lock-note { margin: 6px 2px 0; }
.cards-slot[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #fff; }

/* The picked card: what it does, then Equip or Remove. */
.cards-equip-focus { display: grid; gap: 10px; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: #141414; }
.cards-equip-focus.is-empty { padding: 4px 12px; border-style: dashed; border-color: rgba(255,255,255,.14); background: transparent; }
.cards-equip-hint { margin: 0; padding: 8px 0; color: #b3b3b3; font: 800 14px/18px var(--font-rounded); text-align: center; }
.cards-equip-head { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; }
.cards-equip-art { grid-row: 1 / span 3; width: 56px; height: 70px; border-radius: 6px; background: center / cover no-repeat #0d0d0d; }
.cards-equip-head strong { color: #fff; font: 900 17px/21px var(--font-rounded); }
.cards-equip-head.is-elite strong { color: #c9adff; }
.cards-equip-head.is-boss strong { color: #f2c14e; }
.cards-equip-head span { color: #b3b3b3; font: 800 13px/16px var(--font-rounded); }
.cards-equip-effects { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cards-equip-effects li { padding: 5px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: #1d1d1d; color: #fff; font: 800 14px/17px var(--font-rounded); }
.cards-equip-effects .is-cost { color: #ff9b91; border-color: rgba(255,155,145,.35); }
.cards-equip-actions { display: flex; gap: 8px; }
.cards-equip-button { flex: 1 1 0; min-height: 44px; margin: 0; border: 1px solid rgba(255,255,255,.7); border-radius: 10px; background: #fff; color: #111; font: 900 15px/1 var(--font-rounded); }
.cards-equip-button.is-secondary { background: #1b1b1b; color: #fff; border-color: rgba(255,255,255,.35); }
.cards-equip-button:disabled { opacity: .6; }
.cards-equip-note { margin: 0 2px; color: #b3b3b3; font: 800 13px/16px var(--font-rounded); }
.cards-equip-grid > .inventory-item[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #fff; }
.item-inspection-card-odds { margin: 0; color: #fff; font: 800 13px/17px var(--font-rounded); }
.item-inspection-card-note { margin: 0; color: #b3b3b3; font: 800 13px/17px var(--font-rounded); }
.inventory-item.is-card.is-unfound { border-color: rgba(255,255,255,.08); opacity: .78; }
.inventory-item.is-card.is-unfound > .item-tier-label { color: var(--inventory-muted, #b9bdb9); }
/* A card tile is card-shaped: its enemy's name (up to two lines) over the portrait, the count in the corner. */
.inventory-items > .inventory-item.is-card { aspect-ratio: 3 / 4; grid-template-rows: 24px minmax(0, 1fr); gap: 1px; padding: 3px 3px 4px; }
.inventory-item.is-card.is-elite { border-color: rgba(180,140,255,.45); }
.inventory-item.is-card.is-boss { border-color: rgba(242,193,78,.55); }
.inventory-item.is-card > .item-tier-label { position: static; display: flex; align-items: center; justify-content: center; width: 100%; height: 24px; overflow: hidden; transform: none; font-size: 10px; line-height: 11px; text-align: center; overflow-wrap: break-word; }
.inventory-item.is-card .inventory-item-art-wrap .card-tile-art { width: 100%; height: 100%; image-rendering: auto; }
.item-inspection-icon.is-card img { width: 112px; height: 140px; image-rendering: auto; }
.card-origin { color: #b9c3cc; font: 900 13px/16px var(--font-rounded); }
.card-origin.is-elite { color: #c9adff; }
.card-origin.is-boss { color: #f2c14e; }
.item-inspection-stats [data-stat-kind="card"] { color: #e8eee9; }
.item-inspection-stats [data-stat-kind="cost"] { color: #ff9b91; }
/* A graded helmet or armor's class and set: the perk in white, the set grey until it is on. */
/* A graded piece's class perk or boots' school as a pill; its set in a box with On or Off under it. */
.item-inspection-stats [data-stat-kind="class"] { padding: 5px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: #1d1d1d; color: #fff; font-size: 14px; line-height: 17px; }
.item-inspection-stats [data-stat-kind^="set"] { width: min(100%, 300px); box-sizing: border-box; margin-top: 2px; padding: 8px 12px; border: 1px dashed rgba(255,255,255,.2); border-radius: 12px; color: #bdbdbd; font-size: 14px; font-weight: 800; line-height: 18px; text-align: center; text-wrap: balance; }
.item-inspection-stats [data-stat-kind="set-active"] { border: 1px solid rgba(255,255,255,.6); background: #141414; color: #fff; }
.item-inspection-stats .item-inspection-set-status { display: table; margin: 6px auto 0; padding: 2px 10px; border: 1px solid #fff; border-radius: 999px; background: #fff; color: #111; font-size: 13px; font-weight: 900; text-shadow: none; -webkit-text-stroke: 0; }
.item-inspection-stats [data-stat-kind="set-inactive"] .item-inspection-set-status { border-color: #6a6a6a; background: transparent; color: #9a9a9a; font-weight: 800; }
.item-inspection-metadata > .item-grade-label { padding: 3px 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #e6e6e6; font: 900 13px/16px var(--font-rounded); }
/* A card shield (card-combat.ts): a light strip along the top of the health bar, and its amount after the health. */
.bar > .hp-shield { position: absolute; inset: 0 0 auto 0; height: 34%; border-radius: 5px 5px 0 0; background: #9fdcff; transform: scaleX(0); transform-origin: left center; pointer-events: none; }
#hpText .hp-shield-text { color: #b9e6ff; }
/* The item window's Skills and Cards: titled sections under its stats, each entry on its own dark row. */
.item-inspection-section { display: grid; gap: 6px; text-align: left; }
.item-inspection-section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 0 0; color: #fff; font: 900 15px/18px var(--font-rounded); }
.item-inspection-section-title span { color: var(--muted, #b9bdb9); font-size: 13px; }
/* A skill: its name and chance, a bar for how good the roll is for this weapon, and the range it rolls in. */
.item-skill { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.04); }
.item-skill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.item-skill-head strong { color: #e9eee9; font: 900 14px/18px var(--font-rounded); }
.item-skill-chance { color: #8ff07a; font: 900 15px/18px var(--font-rounded); }
.item-skill-bar { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.item-skill-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3fae35, #8ff07a); }
/* A card slot: the card's portrait framed in its rarity's colour, its name and what it does; an open slot is dashed. */
.item-card-slot { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.04); }
.item-card-art { display: block; width: 44px; height: 55px; overflow: hidden; border: 2px solid #8f9aa3; border-radius: 6px; background: #0d0f0d; }
.item-card-art img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.item-card-slot.is-elite .item-card-art { border-color: #b48cff; }
.item-card-slot.is-boss .item-card-art { border-color: #f2c14e; }
.item-card-slot.is-empty .item-card-art { border-style: dashed; border-color: rgba(255,255,255,.25); background: transparent; }
.item-card-text { display: grid; gap: 2px; min-width: 0; }
.item-card-text strong { color: #dfe6ec; font: 900 14px/18px var(--font-rounded); }
.item-card-slot.is-elite .item-card-text strong { color: #c9adff; }
.item-card-slot.is-boss .item-card-text strong { color: #f2c14e; }
.item-card-slot.is-empty .item-card-text strong { color: var(--muted, #b9bdb9); }
.item-card-text span { color: #d5ddd6; font: 800 13px/17px var(--font-rounded); }
.item-card-slot.is-empty .item-card-text span { color: var(--muted, #b9bdb9); }
html.text-outline-shadow .inventory-stack-count { text-shadow: 1px 0 0 #080b08, -1px 0 0 #080b08, 0 1px 0 #080b08, 0 -1px 0 #080b08, .7px .7px 0 #080b08, -.7px .7px 0 #080b08, .7px -.7px 0 #080b08, -.7px -.7px 0 #080b08; }
/* The Soul Dimension portal's window: its stats and tier progress, in the travel window's frame. */
.soul-sheet .soul-body { display: flex; flex-direction: column; gap: 10px; }
.soul-section { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 2px solid rgba(196,140,255,.28); border-radius: 12px; background: #ffffff06; }
.soul-section h3 { margin: 0 0 2px; color: #d9b8ff; font-size: 15px; }
.soul-row { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-size: 14px; }
.soul-row strong { color: #fff; font-variant-numeric: tabular-nums; }
.soul-row.is-done strong { color: #7ee08a; }
.soul-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.soul-level-bar { display: block; height: 8px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.14); }
.soul-level-bar > span { display: block; height: 100%; border-radius: inherit; background: #c48cff; transition: width .2s; }
.soul-level-xp { margin: 0; color: #fff; font-size: 14px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.farm-sheet .soul-toggle { justify-content: center; font-weight: 700; }
.guild-hall-sheet .soul-section { border-color: rgba(255,207,107,.28); }
.guild-hall-sheet .soul-section h3 { color: #ffd98a; }
.guild-hall-crest { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 0; color: #fff; font-size: 16px; }
.guild-hall-crest .guild-hall-badge { width: 52px; height: 52px; }
.guild-hall-sheet .guild-hall-fund { color: #ffd98a; font-size: 14px; font-weight: 700; }
.farm-sheet .guild-hall-upgrade { margin-top: 4px; font-size: 13px; }
.guild-hall-sheet .guild-hall-enter[hidden] { display: none; }

/* A card found: rays, a burst and sparks in its rarity's colour behind the card, until tapped. */
.card-found { --card-found-color: #b9c3cc; position: fixed; inset: 0; z-index: 38; pointer-events: none; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 40%, rgba(0,0,0,.3), rgba(0,0,0,.78)); cursor: pointer; animation: card-found-in .25s ease-out both; }
.card-found[hidden] { display: none; }
.card-found-rays, .card-found-burst, .card-found-sparks { position: absolute; top: 40%; left: 50%; pointer-events: none; }
/* Sized to the circle the mask leaves visible (a 40vmax radius): it was 190vmax, five times the pixels to turn. */
.card-found-rays { width: 84vmax; height: 84vmax; background: repeating-conic-gradient(from 0deg, var(--card-found-color) 0deg 4deg, transparent 4deg 15deg); -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0,0,0,.8) 15.8%, transparent 67.9%); mask-image: radial-gradient(circle, #000 0, rgba(0,0,0,.8) 15.8%, transparent 67.9%); opacity: 0; transform: translate(-50%, -50%); will-change: transform; animation: card-found-rays-in .7s ease-out .1s forwards, card-found-spin 24s linear 3; }
.card-found-burst { width: 72vmin; height: 72vmin; border-radius: 50%; background: radial-gradient(circle, #fff 0, var(--card-found-color) 26%, transparent 66%); opacity: 0; transform: translate(-50%, -50%) scale(.2); will-change: transform, opacity; animation: card-found-burst .8s ease-out forwards; }
.card-found-sparks { width: 0; height: 0; }
.card-found-sparks > span { position: absolute; top: -4px; left: -4px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px var(--card-found-color); opacity: 0; animation: card-found-spark .9s cubic-bezier(.2, .7, .3, 1) forwards; }
.card-found-body { position: relative; display: grid; justify-items: center; gap: 6px; width: min(340px, calc(100vw - 32px)); margin-top: -4vh; color: #fff; text-align: center; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0,0,0,.8); }
.card-found-kicker { margin: 0; color: var(--card-found-color); font: 900 clamp(16px, 4.6vw, 21px)/1 var(--player-name-font); letter-spacing: .08em; animation: card-found-rise .4s ease-out both; }
.card-found-art { position: relative; width: clamp(140px, 42vw, 176px); aspect-ratio: 4 / 5; overflow: hidden; border-radius: 12px; box-shadow: 0 0 16px var(--card-found-color); will-change: transform; animation: card-found-pop .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.card-found-art img { display: block; width: 100%; height: 100%; }
.card-found-shine { position: absolute; top: -20%; bottom: -20%; left: 0; width: 38%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.7), transparent); transform: translateX(-170%) skewX(-18deg); animation: card-found-shine 2.6s ease-in-out .5s 3; }
.card-found-name { margin: 6px 0 0; color: #fff; font: 900 clamp(21px, 6.2vw, 29px)/1.05 var(--player-name-font); animation: card-found-rise .45s ease-out .35s both; }
.card-found-origin { margin: 0; color: var(--card-found-color); font: 800 13px/1.2 var(--font-rounded); animation: card-found-rise .45s ease-out .45s both; }
.card-found-effects { display: grid; gap: 3px; margin-top: 2px; font: 900 15px/1.25 var(--font-rounded); animation: card-found-rise .45s ease-out .55s both; }
.card-found-effects [data-stat-kind="cost"] { color: #ff9b91; }
@keyframes card-found-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-found-rays-in { to { opacity: .42; } }
@keyframes card-found-spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes card-found-burst { 0% { opacity: .95; transform: translate(-50%, -50%) scale(.2); } 60% { opacity: .55; } 100% { opacity: .3; transform: translate(-50%, -50%) scale(1.15); } }
@keyframes card-found-spark { 0% { opacity: 1; transform: translate(0, 0) scale(1.3); } 100% { opacity: 0; transform: translate(var(--spark-x), var(--spark-y)) scale(.4); } }
@keyframes card-found-pop { 0% { opacity: 0; transform: scale(.2) rotate(-10deg); } 55% { opacity: 1; transform: scale(1.12) rotate(2deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes card-found-shine { 0% { transform: translateX(-170%) skewX(-18deg); } 40%, 100% { transform: translateX(400%) skewX(-18deg); } }
@keyframes card-found-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .card-found, .card-found * { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}

/* A zone's heading across the Cards grid: its name and found count between two hairlines fading out. */

.cooking-fire [hidden], .cook-sub-sheet [hidden] { display:none !important; }
