/* Dark Mage of Mossfen — the Market Tide window (v0.80, ui/ledger.js): the game master's settings for what the
   merchants pay, opened at Marlo the Fisherman in Stillhaven. Same glass as the Shop and the gate list; the tide
   gauge in the mere's own colours (cold teal water, the glowfins' cyan). */
#ledger {
  top: 12px; right: 12px; z-index: 5;
  width: min(380px, calc(100% - 24px));
  max-height: calc(100% - 100px);
  overflow-y: auto;
  padding: 10px 14px 12px;
  --tide: #5fe6ff;
  --tide-deep: #0f5b6e;
}
#ledger header { align-items: center; }
#ledger header .win-meta { margin-left: 10px; }
#ledger header .win-close { margin-left: auto; }
.tide-who { display: flex; align-items: center; gap: 12px; padding: 2px 0 8px; }
.tide-who img {
  width: 64px; height: 64px; flex: none; border-radius: 6px; object-fit: cover;
  background: radial-gradient(circle at 50% 70%, #123a44, #070b0d 75%); border: 1px solid rgba(95, 230, 255, 0.35);
}
.tide-who p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-dim); }
.tide-who p b { color: var(--ink); font-weight: 700; }

.tide-rate { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 6px; }
.tide-rate b { font: 400 34px/1 var(--f-num); color: var(--tide); text-shadow: 0 0 14px rgba(95, 230, 255, 0.45); }
.tide-rate small { font-size: 13.5px; color: var(--ink-dim); }
#ledger[data-tide="mid"] .tide-rate b { color: #ffd76a; text-shadow: 0 0 14px rgba(255, 215, 106, 0.35); }
#ledger[data-tide="low"] .tide-rate b { color: #ff8f73; text-shadow: 0 0 14px rgba(255, 120, 90, 0.4); }

.tide-gauge {
  position: relative; display: block; height: 16px; border-radius: 8px; overflow: hidden;
  background: #071014; border: 1px solid rgba(95, 230, 255, 0.28); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}
.tide-gauge i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.10) 0 6px, transparent 6px 14px),
    linear-gradient(180deg, #8ff4ff, var(--tide) 35%, var(--tide-deep));
  box-shadow: 0 0 10px rgba(95, 230, 255, 0.55);
  transition: width 0.6s ease-out;
}
.tide-gauge u { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #ff8f73; text-decoration: none; }

.tide-facts { margin: 8px 0 4px; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13.5px; }
.tide-facts dt { color: var(--ink-faint); }
.tide-facts dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }

.tide-form { margin: 10px 0 0; padding: 10px 10px 8px; border-radius: 4px; background: rgba(11, 15, 12, 0.6); border: 1px solid rgba(95, 230, 255, 0.16); }
.tide-form h4 { margin: 0 0 8px; font: 700 12px/1 var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: #9fe9f7; }
.tide-form label { display: grid; grid-template-columns: 1fr 128px; align-items: center; gap: 2px 10px; margin-bottom: 7px; }
.tide-form label span { font-size: 14px; color: var(--ink); }
.tide-form label small { grid-column: 1 / -1; font-size: 12px; color: var(--ink-faint); line-height: 1.3; }
.tide-form input {
  width: 100%; padding: 6px 8px; border-radius: 4px; text-align: right;
  font: 400 15px/1 var(--f-num); color: var(--ink); background: #0b1210; border: 1px solid var(--edge);
}
.tide-form input:focus { outline: 2px solid var(--tide); outline-offset: 0; border-color: transparent; }
.tide-form .pick-go { width: 100%; margin-top: 2px; }

.tide-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.tide-actions .link-btn { margin: 0; }
.tide-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-faint); }
body.ledger-open #help, body.ledger-open #quest-track { visibility: hidden; }
