/* The arb ticket (ticket.js): the picked arb on the Arbs tab, in the third column (#arbSide) or a sheet (.arbtk). One
   stylesheet for the whole card, from the root down; nothing is taken from the column, the sheet or the Odds panel.

   The system: a 4 px spacing scale (4 / 8 / 12 / 16); two text colours (ink, muted) and the green for money; the display
   face for the big numbers (teams, prices, profit), the body face for words, the number face for the book rows' odds (the
   Odds panel's). Controls are 36 px tall with 6 px corners; the ledger's boxes 28 px. The right leg mirrors the left: the
   button at the outer edge and the field inside, the price inside and the side at the edge, the book rows with their odds
   inside and logos at the edge (the Odds panel's Books table). */
.tkt,
.tkt * {
  box-sizing: border-box;
  text-align: left;
}
/* the column keeps its place while the list scrolls, scrolling inside when taller than the window */
#arbSide {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.tkt {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font: 400 13px/1.3 var(--body);
  font-variant-numeric: tabular-nums;
}
.tkt.gone > :is(.tkt-legs, .tkt-sum, .tkt-hist) {
  opacity: 0.5;
}

/* ---- the game line: the teams, the time at the right ---- */
.tkt-game {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  min-width: 0;
  font: 700 13px/1 var(--display);
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.tkt-game img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.tkt-game i {
  font-style: normal;
  font-weight: 400;
  color: var(--faint);
}
.tkt-game .when {
  margin-left: auto;
  font: 500 12px/1 var(--body);
  color: var(--muted);
}
.tkt-game .when.lv {
  color: var(--pos);
  font-weight: 600;
}

/* ---- the title: the line and stat, the player under it; how long the arb has been open at the right ---- */
.tkt-m {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
}
.tkt-m h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 600 16px/1.25 var(--body);
  color: var(--ink);
}
.tkt-m h3 b {
  display: block;
  font-weight: 600;
}
.tkt-m h3 span {
  display: block;
  margin-top: 2px;
  font: 500 13px/1.25 var(--body);
  color: var(--muted);
}
.tkt-m .clock {
  flex: none;
  font: 500 12px/1 var(--body);
  color: var(--muted);
  white-space: nowrap;
}

/* ---- the two bets: two columns on shared rows (button + field / side + price / the price's facts / the other books), a
   hairline between ---- */
.tkt-legs {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 24px;
  margin-top: 16px;
}
.tkt-legs::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px solid var(--line);
}
.tkt-leg {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  align-content: start;
  min-width: 0;
}
/* row 1: the book as the button to it, the stake field beside it */
.tkt-l1 {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.tkt-leg[data-side='no'] .tkt-l1 {
  flex-direction: row-reverse;
}
.tkt-bk {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  height: 36px;
  padding: 0 7px 0 8px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.tkt-bk img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
}
.tkt-bk svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.65;
}
a.tkt-bk:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px -2px rgb(0 0 0 / 0.3);
}
a.tkt-bk:hover svg {
  opacity: 1;
}
a.tkt-bk:active {
  transform: none;
  box-shadow: none;
}
.tkt-bk.page {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.tkt-bk.page:hover {
  border-color: var(--ink);
}
.tkt-bk.off {
  cursor: not-allowed;
}
.tkt-st {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1px;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font: 600 16px/1 var(--body);
  color: var(--ink);
  cursor: text;
}
.tkt-st i {
  font-style: normal;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
}
/* row 2: the side and the price, the price on the inside */
.tkt-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  min-width: 0;
}
.tkt-leg[data-side='no'] .tkt-line {
  flex-direction: row-reverse;
}
.tkt-line .side {
  min-width: 0;
  font: 600 15px/1 var(--body);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tkt-line .px {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font: 700 22px/1 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tkt-line .px small {
  font: 400 11px/1 var(--body);
  color: var(--muted);
}
/* row 3: the price's facts, under the side (the outer edge): how long it has held, soft, what rests */
.tkt-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-height: 16px;
  margin-top: 6px;
  font: 500 11px/1 var(--body);
  color: var(--muted);
}
.tkt-leg[data-side='no'] .tkt-trust {
  justify-content: flex-end;
}
.tkt-trust .now {
  color: var(--ink);
  font-weight: 600;
}
.tkt-trust .soft {
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--pos-tint);
  color: var(--pos);
  font-weight: 600;
  letter-spacing: 0.02em;
}
/* row 4: the other books on this side, best first: the Odds panel's book rows */
.tkt-others {
  margin-top: 8px;
}
.tkt-others:empty {
  margin: 0;
}
.tkt-others .bk {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  min-width: 0;
  font: 400 13px/1 var(--body);
  color: var(--muted);
  text-decoration: none;
}
.tkt-others .bk img {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: contain;
}
.tkt-others .bk .nm {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tkt-others .bk b {
  flex: none;
  font: 400 14px/1 var(--num);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.tkt-others a.bk:hover .nm {
  color: var(--ink);
  text-decoration: underline;
}

/* ---- the fields' input ---- */
.tkt input {
  flex: 1;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.tkt input::-webkit-outer-spin-button,
.tkt input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.tkt input:focus {
  outline: none;
}
.tkt-st:focus-within,
.tkt-sum .v:focus-within {
  border-color: var(--ink);
}

/* ---- the sum, as a receipt: what went in, what comes back, what's left; label left, number right, the numbers in one
   column; the payout the one line you can type (a number with a quiet underline, ink while you type); the profit the
   bottom line, heavier, its return beside it ---- */
.tkt-sum {
  margin-top: 14px;
  padding-top: 6px;
  border-top: 1px solid var(--line-strong);
}
.tkt-sum .r {
  display: flex;
  align-items: baseline;
  gap: 8px;
  height: 28px;
  margin: 0;
  font: 400 13px/28px var(--body);
  color: var(--muted);
}
.tkt-sum .r > span:first-child {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.tkt-sum .r > b {
  font: 600 14px/28px var(--body);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tkt-sum .max {
  font: 600 9px/1 var(--body);
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pos);
}
.tkt-sum .max[hidden] {
  display: none;
}
.tkt-sum label.r {
  cursor: text;
}
.tkt-sum .v {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  border-bottom: 1px dotted var(--line-strong);
}
.tkt-sum .v i {
  font-style: normal;
  font-weight: 600;
}
.tkt-sum .v input {
  width: auto;
  flex: none;
  min-width: 2ch;
  text-align: right;
}
.tkt-sum .v:focus-within {
  border-bottom: 1px solid var(--ink);
}
.tkt-sum .pf {
  height: 40px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
  line-height: 40px;
}
.tkt-sum .pf > b {
  font: 700 20px/40px var(--display);
  letter-spacing: -0.01em;
  color: var(--pos);
}
.tkt-sum .pf.neg > b {
  color: var(--muted);
}

/* ---- the price history: the Odds panel's chart (v9.css .ps.hist, reached through its v9p class), under the ledger ---- */
.tkt .tkt-hist {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---- Share card / Save ---- */
.tkt-foot {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 12px;
}
.tkt-foot button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: 500 12px/1 var(--body);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
  cursor: pointer;
}
.tkt-foot button:hover {
  color: var(--ink);
}

/* ---- the sheet (ticket.js arbTkPop): the card as the sheet's body, the close over its top right; on a phone from the
   bottom (phone.css .p7), its bottom padding clearing the home bar ---- */
.pop .popcard.arbtk {
  position: relative;
  display: block;
  width: min(460px, 100%);
  padding: 0;
  gap: 0;
}
.arbtk .tkt-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 28px;
  height: 28px;
  font-size: 18px;
}
.arbtk .tkt {
  border: 0;
  border-radius: 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
}
.arbtk .tkt-game {
  padding-right: 32px;
}
