/* tracker-widgets.css — toast and dialog, the hover card, the pickers, first-run guidance, the pouch, the tree, the header on a phone, the links out, what a thing costs.
   One of nine sheets that were one file, cut at its section marks and
   linked in the same order (tracker-base, tracker-shell, tracker-yard, tracker-widgets, tracker-map, tracker-sea, tracker-extras, tracker-barter, tracker-recent), so the cascade is what it was: a
   rule here still loses to the same rule in a later sheet. When moving a
   rule between sheets, check nothing later relies on beating it. */

/* ---- toast & dialog ----------------------------------------------- */

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---- hover card: what a thing is made of ---------------------------- */

.peek {
  position: fixed;
  z-index: 45;
  width: 300px;
  max-width: calc(100vw - 24px);
  padding: 12px 14px;
  border-radius: var(--r-panel);
  border: 1px solid rgba(var(--line-rgb), 0.28);
  background: rgba(var(--deep-rgb), 0.97);
  box-shadow: 0 14px 40px rgba(var(--shade-rgb), 0.55);
  backdrop-filter: blur(10px);
}

.peek[hidden] { display: none; }

.peek-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.14);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-hi);
  line-height: 1.3;
}

.peek-label {
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}

.peek-line,
.ing-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
  color: var(--ink-row);
}

.peek-icon { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; flex: none; }
.peek-icon.lg { width: 28px; height: 28px; border-radius: 6px; }

.peek-need {
  font-family: var(--font-display);
  font-weight: 700;
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.peek-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.peek-have {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.peek-line.ok .peek-have, .ing-line.ok .peek-have { color: var(--teal); }
.peek-line.short .peek-have, .ing-line.short .peek-have { color: var(--red); }

/* With no ingredient list between them, the head rule and the foot rule
   sit on top of each other. */
.peek:not(:has(.peek-label)) .peek-head { border-bottom: none; padding-bottom: 0; margin-bottom: 6px; }
.peek:not(:has(.peek-label)) .peek-foot { border-top: none; padding-top: 0; margin-top: 0; }

.peek-foot {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(var(--line-rgb), 0.14);
  font-size: 11px;
  color: var(--ink-faint);
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  /* Above everything, dialogs included. A toast is the answer to what
     you just did -- "written", "could not reach the clipboard" -- and
     the thing you did it from is usually a dialog still standing open,
     so anything less than the top of the stack means the answer is
     posted behind the question. The order below it: guide tip 500,
     dialog 60, detail sheet 55, veil 54, peek 45, shell 1. */
  z-index: 1000;
  background: rgba(var(--deep-rgb), 0.95);
  border: 1px solid rgba(var(--line-rgb), 0.35);
  border-radius: var(--r-tile);
  padding: 10px 18px;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(var(--shade-rgb), 0.5);
  animation: toastIn 0.2s ease;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 14px;
}

.toast[hidden] { display: none; }
.toast button { background: none; border: none; color: var(--blue); font-weight: 700; font-size: 13px; }

.dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  /* A veil, not a blur: blurring the whole viewport makes Chrome
     re-rasterise every blurred panel underneath the moment a dialog
     opens, which showed as a flicker; at this opacity the blur was
     not visible anyway. */
  background: rgba(var(--deep-rgb), 0.8);
  padding: 16px;
}

.dialog[hidden] { display: none; }

.dialog-box {
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--sheet-solid);
  border: 1px solid rgba(var(--line-rgb), 0.2);
  border-radius: var(--r-panel);
  padding: 22px;
}

.dialog-box h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-hi);
}

.dialog-box p { margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: var(--ink-dim); }

.dialog-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.dialog-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 12.5px; color: var(--ink-mid); }
.dialog-row .n { font-family: var(--font-display); color: var(--ink-hi); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---- responsive --------------------------------------------------- */

@media (max-width: 960px) {
  .inv-layout { grid-template-columns: minmax(0, 1fr); }
  .detail { position: static; }
}

@media (max-width: 720px), ((max-height: 520px) and (pointer: coarse)) {
  .shell { padding: 0 16px 70px; }
  .masthead { padding: 18px 0 14px; }
  .brand-name { font-size: 16px; }
  .row { gap: 10px; padding: 11px 14px; }
  .row-meter { flex-basis: 100%; min-width: 0; }
  .row-tail { width: 100%; justify-content: space-between; }
  .badge { text-align: left; min-width: 0; }
  .panel-head, .group-head { padding: 12px 14px 10px; }
  .panel > .kv { padding: 10px 14px 12px; }
  .sel-facts { padding: 10px 14px 12px; }
  .stat { padding: 13px 16px; }
  .craft-grid { padding: 12px 14px; }
  .build { padding: 14px; gap: 12px; }
  .build-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 480px) {
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .ghost-btn { flex: 1 1 auto; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  * { transition: none !important; }
}

/* ---- build picker -------------------------------------------------- */

.add-build { flex: 0 0 auto; padding: 8px 16px; font-size: 13px; }

.picker-search { width: 100%; margin-bottom: 12px; }

/* Two different things have been called a picker. Here -- the Tree's
   target list, the build queue's chooser -- the .picker element *is* the
   scrolling list, so it carries the frame and the height. The dialog one
   in picker.js is a column holding a search box, its own scrolling
   .picker-list and a row of buttons; capping that at 320px squeezed the
   list to two and a half rows and put a second scrollbar around the
   first, which is what made the trip log's chooser feel like a letterbox.
   So this rule stays with the widget it was written for. */
.picker:not(.picker-dialog) {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  margin-bottom: 14px;
}

.picker-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-mid);
  font-size: 13px;
  text-align: left;
}

.picker-row:last-child { border-bottom: none; }
.picker-row:hover:not(:disabled) { background: rgba(var(--blue-rgb), 0.08); color: var(--ink-hi); }
.picker-row:disabled { opacity: 0.45; cursor: default; }
.picker-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.picker-tag {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- record what you own, straight from a plan row ------------------ */

.own {
  display: flex;
  align-items: center;
  border: 1px solid rgba(var(--line-rgb), 0.18);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.own .sq-btn { border: none; border-radius: 0; width: 26px; height: 28px; }

.own-input {
  width: 66px;
  height: 28px;
  border: none;
  border-left: 1px solid rgba(var(--line-rgb), 0.14);
  border-right: 1px solid rgba(var(--line-rgb), 0.14);
  background: rgba(var(--shade-rgb), 0.18);
  color: var(--ink-hi);
  font-family: var(--font-display);
  font-size: 12.5px;
  text-align: center;
  -moz-appearance: textfield;
}

.own-input::-webkit-outer-spin-button,
.own-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Every quantity in the app is typed into the same way. */
.amt { -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.amt::-webkit-outer-spin-button,
.amt::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amt:focus { outline: none; box-shadow: inset 0 0 0 1px var(--blue-edge); color: var(--blue-hi); }
.amt:focus::selection { background: rgba(var(--blue-rgb), 0.35); }

/* ---- first-run guidance -------------------------------------------- */

.steps { list-style: none; margin: 0; padding: 0; }

.step {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.step:last-child { border-bottom: none; }

.step-n {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--blue-edge);
  background: var(--blue-glow);
  color: var(--blue);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

.step-title { font-weight: 600; font-size: 14px; color: var(--ink-hi); }
.step-body { font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; line-height: 1.5; }
.step-cta { flex: 0 0 auto; padding: 8px 14px; font-size: 12.5px; white-space: nowrap; }

@media (max-width: 720px), ((max-height: 520px) and (pointer: coarse)) {
  .step { grid-template-columns: 30px 1fr; }
  .step-cta { grid-column: 2; justify-self: start; }
}

/* ---- next step + pouch --------------------------------------------- */

.next-step {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 20px;
  border-radius: var(--r-panel);
  border: 1px solid rgba(var(--blue-rgb), 0.28);
  background: linear-gradient(90deg, var(--wash-blue), var(--panel));
  backdrop-filter: blur(6px);
}

.next-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  white-space: nowrap;
}

.next-msg { flex: 1 1 260px; font-size: 13px; color: var(--ink-row); }
.next-cta { flex: 0 0 auto; padding: 7px 14px; font-size: 12.5px; white-space: nowrap; }

/* The pouch sits between the tabs and the screen and follows you across
   all five of them, because coins and stones are spent from every one. */
.pouch {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  /* Under the dock, which sticks above it; the dock publishes its
     height (ui.js), and it is nought where the thumb bar does the job. */
  position: sticky;
  top: var(--dock-h, 0px);
  z-index: 6;
  margin: 0 0 22px;
  padding: 11px 18px;
  border-radius: var(--r-panel);
  border: 1px solid var(--line);
  background: rgba(var(--deep-rgb), 0.86);
  backdrop-filter: blur(10px);
}

.pouch:empty { display: none; }

.pouch-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

.pouch-list {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.pouch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  background: rgba(var(--shade-rgb), 0.2);
  cursor: text;
}

.pouch-item:hover { border-color: rgba(var(--line-rgb), 0.22); }
.pouch-item.short { border-color: rgba(232, 122, 109, 0.3); }
.pouch-item.ok { border-color: rgba(78, 201, 174, 0.26); }

.pouch-icon,
.pouch-glyph {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 6px;
  object-fit: contain;
}

.pouch-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #b9c9dc;
  background: rgba(120, 160, 200, 0.12);
}

.pouch-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.pouch-k {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

.pouch-input {
  /* Wide enough for thirteen characters: silver reached ten figures the
     day the yellow permits arrived at five billion each. */
  width: 148px;
  /* The chips wrap, so a phone can spare the width -- and 34vw used to
     cut the last two digits off a ten-figure silver balance. */
  max-width: 60vw;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink-hi);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.pouch-input::-webkit-outer-spin-button,
.pouch-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pouch-input:focus { outline: none; color: var(--blue-hi); }

.pouch-item.short .pouch-input { color: var(--amber); }
.pouch-item.ok .pouch-input { color: var(--teal); }

.pouch-need { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.pouch-item.short .pouch-need { color: var(--red); }

/* One scrolling row beats three stacked ones on a bar that is always on
   screen. Kept here, after the base rules, so it actually wins. */
@media (max-width: 720px), ((max-height: 520px) and (pointer: coarse)) {
  .pouch { gap: 10px; padding: 9px 12px; margin: 0 0 18px; }
  .pouch-title { display: none; }
  .pouch-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    /* A swipeable row has to look like one. Without this the last purse
       in view is simply cut off mid-digit at the edge, which reads as a
       rendering fault rather than an invitation -- so the row fades out
       where it continues, and only where it continues: the mask is tied
       to how far it has actually been scrolled, so a row with nothing
       more to show has hard edges like everything else.

       scroll-driven animations do the tying; a browser without them
       keeps a plain, always-on fade at the right, which is still the
       honest hint and costs nothing. */
    --pouch-fade: 22px;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - var(--pouch-fade)), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - var(--pouch-fade)), transparent 100%);
    scrollbar-width: none;
  }
  .pouch-list::-webkit-scrollbar { display: none; }
  .pouch-item { flex: none; }
  /* The row scrolls here, so the extra width costs nothing but a swipe,
     and ten-figure silver no longer loses its last two digits. */
  .pouch-input { width: 124px; font-size: 15px; }
}

/* The fade, told where the row actually is: none at the very start on
   the left, none at the very end on the right, both in the middle. */
@supports (animation-timeline: scroll(self inline)) {
  @media (max-width: 720px), ((max-height: 520px) and (pointer: coarse)) {
    .pouch-list {
      --pouch-fade-l: 0px;
      --pouch-fade-r: 22px;
      -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--pouch-fade-l), #000 calc(100% - var(--pouch-fade-r)), transparent 100%);
      mask-image: linear-gradient(to right, transparent 0, #000 var(--pouch-fade-l), #000 calc(100% - var(--pouch-fade-r)), transparent 100%);
      animation: pouch-edges linear both;
      animation-timeline: scroll(self inline);
    }
    /* Held still for anyone who has asked for that: the always-on
       right-hand fade says "there is more" without moving. */
    @media (prefers-reduced-motion: reduce) {
      .pouch-list { animation: none; --pouch-fade-l: 0px; --pouch-fade-r: 22px; }
    }
  }
}

@property --pouch-fade-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --pouch-fade-r { syntax: '<length>'; inherits: false; initial-value: 22px; }

@keyframes pouch-edges {
  from { --pouch-fade-l: 0px;  --pouch-fade-r: 22px; }
  to   { --pouch-fade-l: 22px; --pouch-fade-r: 0px; }
}

.summary-sub { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }

.purse-inline {
  width: 96px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(var(--line-rgb), 0.2);
  background: rgba(var(--shade-rgb), 0.22);
  color: var(--ink-dim);
  font-family: var(--font-display);
  font-size: 11px;
  -moz-appearance: textfield;
}

.purse-inline::-webkit-outer-spin-button,
.purse-inline::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.purse-inline:focus { border-color: var(--blue-edge); color: var(--ink-hi); }

/* ---- what an enhancement really costs ------------------------------ */

.enh-odds {
  display: block;
  font-size: 10.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  margin-top: 2px;
}

.enh-outlook {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-mute);
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: var(--r-btn);
  border: 1px solid rgba(var(--line-rgb), 0.16);
  background: rgba(var(--shade-rgb), 0.18);
}

.enh-outlook b { color: var(--amber); font-family: var(--font-display); }

/* ---- two ways to build the same ship -------------------------------- */

.route-list { display: flex; flex-direction: column; gap: 6px; }

.route {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(var(--line-rgb), 0.18);
  background: rgba(var(--shade-rgb), 0.18);
  color: var(--ink-dim);
}

.route:hover { border-color: var(--line-btn-hi); color: var(--ink-hi); }
.route.on { border-color: var(--blue-edge); background: rgba(var(--blue-rgb), 0.12); color: var(--ink-hi); }

.route-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route-name { font-weight: 600; font-size: 12.5px; }

.route-have {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid var(--teal-edge);
  border-radius: 8px;
  padding: 1px 6px;
}

.route-cost { font-size: 11px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.route-gain { font-size: 11px; color: var(--ink-faint); line-height: 1.45; }

/* ---- the requirement tree ------------------------------------------- */

.tbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* One button naming the build on screen, whatever the queue length. */
.tpick {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1 1 260px;
  max-width: 460px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--blue-edge);
  background: rgba(var(--blue-rgb), 0.12);
  color: var(--ink-hi);
  font-size: 13px;
  font-weight: 600;
}

.tpick:hover { border-color: rgba(var(--blue-rgb), 0.7); }
.tpick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.tpick-of { font-size: 11px; font-weight: 500; color: var(--ink-mute); white-space: nowrap; }
.tpick-caret { color: var(--ink-mute); font-size: 11px; }
.tchip-icon { width: 22px; height: 22px; border-radius: 4px; object-fit: contain; flex: none; }

.picker-row.on { border-color: var(--blue-edge); background: rgba(var(--blue-rgb), 0.12); }

.tpanel { padding: 10px 14px 12px; overflow-x: auto; }

.trow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 8px;
  min-width: 620px;
}

.trow:hover { background: rgba(var(--blue-rgb), 0.05); }

/* One cell per ancestor: a line where the branch continues below, an
   elbow on the last one. */
/* The negative margin is what makes the vertical lines meet across rows:
   without it each stops at the row's padding and the branch looks broken. */
.tguide { position: relative; width: 22px; flex: none; align-self: stretch; margin: -5px 0; }
.tguide::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(var(--line-rgb), 0.2);
}
.tguide.stop::before { bottom: 50%; }
.tguide.elbow::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 11px;
  height: 1px;
  background: rgba(var(--line-rgb), 0.2);
}
.tguide.elbow::before { bottom: 50%; }

.tcaret {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 5px;
  border: 1px solid rgba(var(--line-rgb), 0.25);
  background: none;
  color: var(--ink-mute);
  font-size: 11px;
  line-height: 1;
}
.tcaret:hover { color: var(--ink-hi); border-color: var(--line-btn-hi); }
.tcaret.empty { border: none; }
.tcaret.open { border: none; color: var(--ink-faint); cursor: default; }
.tcaret.open::before { content: '−'; }

.trow-icon { width: 26px; height: 26px; border-radius: 5px; object-fit: contain; flex: none; }
.trow-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.trow-name { font-size: 12.5px; color: var(--ink-row); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.missing .trow-name { color: var(--ink-hi); }
.trow-sub { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.trow-need,
.trow-own {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  flex: none;
  text-align: right;
}
.trow-need { min-width: 54px; color: var(--ink-dim); }
.trow-own { min-width: 68px; color: var(--ink-faint); }

.tlegend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-mute); padding-left: 4px; }
.tlegend span { display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.teal { background: var(--teal); }
.dot.blue { background: var(--blue); }
.dot.red { background: var(--red); }

@media (max-width: 720px), ((max-height: 520px) and (pointer: coarse)) {
  .trow { min-width: 520px; }
  .trow-own { display: none; }
}

/* An inline "change" that reads as part of the sentence around it. */
.linky {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linky:hover { color: var(--blue-hi); }

.detail-close {
  margin-left: auto;
  align-self: flex-start;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--ink-mute);
  font-size: 17px;
  line-height: 1;
}
.detail-close:hover { color: var(--ink-hi); border-color: var(--line-btn-hi); }

/* ---- the header on a phone ------------------------------------------ */
/* The masthead keeps Undo, the account and the menu on a phone; the
   rest of its verbs are the first thing in the menu. The sections
   themselves are the thumb bar's (tracker-sea.css). */

@media (max-width: 720px), ((max-height: 520px) and (pointer: coarse)) {
  .tbar { gap: 6px; }
  .tpick { flex: 1 1 100%; max-width: none; }
  .tbar .ghost-btn { flex: 1 1 auto; text-align: center; }
}


@media (max-width: 720px), ((max-height: 520px) and (pointer: coarse)) {
  /* The tree has to fit the screen rather than scroll sideways inside a
     panel that is already the width of the phone. */
  .tpanel { padding: 8px 10px 10px; }
  .trow { min-width: 0; gap: 7px; padding: 5px 2px; }
  .tguide { width: 14px; }
  .tguide::before { left: 6px; }
  .tguide.elbow::after { left: 6px; width: 7px; }
  .trow-need { display: none; }
  /* The verdict is the point of the row; the name wraps, the word holds. */
  .trow .badge { flex: none; white-space: nowrap; }
  .trow-name { white-space: normal; line-height: 1.3; }
  .trow-icon { width: 22px; height: 22px; }
}

/* The walkthrough film, in the help dialog. */
.help-film {
  display: block;
  width: 100%;
  max-height: 62vh;
  margin: 4px 0 14px;
  border-radius: var(--r-panel);
  border: 1px solid rgba(var(--line-rgb), 0.2);
  background: #06111e;
}

@media (max-width: 720px), ((max-height: 520px) and (pointer: coarse)) {
  /* Leave room for the buttons under it: the dialog scrolls, but the
     thing you are meant to press should not start below the fold. */
  .help-film { max-height: 42vh; }
}

/* The inventory detail is one of the sheets at the foot of this file. */
.detail-veil { display: none; }

/* ---- links out to BDOCodex ------------------------------------------ */

/* Every item name in the app is a link to the game's own reference. It
   has to read as a name first and a link second, or the Plan turns into
   a page of blue text. */
a.codex {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a.codex:hover,
a.codex:focus-visible {
  color: var(--blue-hi);
  border-bottom-color: rgba(124, 195, 238, 0.45);
}

.codex-mark {
  font-size: 0.75em;
  margin-left: 3px;
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity 120ms ease;
}

a.codex:hover .codex-mark,
a.codex:focus-visible .codex-mark { opacity: 1; color: var(--blue); }

/* The hover card is for reading and for its one button; a link out of it
   would take the pointer away from what it was hovering. */
.peek a.codex { color: inherit; border-bottom: none; pointer-events: none; }
.peek .codex-mark { display: none; }

/* ---- what a thing really costs -------------------------------------- */

.way {
  padding: 8px 10px;
  border-radius: var(--r-btn);
  border: 1px solid rgba(var(--line-rgb), 0.14);
  background: rgba(255, 255, 255, 0.015);
}

.way + .way { margin-top: 6px; }
.way.on { border-color: var(--blue-edge); background: var(--blue-glow); }

.way-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.way-label { font-size: 11.5px; font-weight: 700; color: var(--ink-mid); }
.way-tag { font-size: 10px; color: var(--blue); margin-left: auto; }

.way-cost {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--ink-row);
  font-variant-numeric: tabular-nums;
}

.way-unit { font-family: inherit; font-size: 11px; color: var(--ink-faint); }

.way-total {
  font-size: 11.5px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.way-parts { font-size: 10.5px; color: var(--ink-faint); margin-top: 4px; line-height: 1.45; }

.peek-cost {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--ink-mid);
  font-variant-numeric: tabular-nums;
}

.row-alt { font-size: 11px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* What a barter costs in sea time. It sits below the shop price it is
   competing with, and unlike .row-alt it is allowed to wrap: the whole
   point is the clause after the dash, so truncating it would leave the
   line saying nothing the row above did not already say. */
.row-sea {
  font-size: 11px;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.row-sea.locked { color: var(--ink-mute); }

.row-sea-why { color: var(--ink-faint); }
.row-sea-why::before { content: "· "; }

/* A tick that reads as part of the sentence it interrupts. */
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.inline-check input { margin: 0; cursor: pointer; }

/* A voucher count is two digits; the level names are long. Both borrow
   the purse field's look rather than inventing a second one. */
.purse-inline.narrow { width: 44px; }
select.purse-inline { width: auto; cursor: pointer; }

/* Nothing hovers on a phone, so the arrow has to be there all along or
   nobody ever finds out the names are links. */
@media (hover: none) {
  .codex-mark { opacity: 0.55; }
  .peek .codex-mark { display: none; }
}

.build-cost {
  font-size: 11.5px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

