/* /farm and /hedge: the same instrument as the main page, with an answer card, a form and a table of their own */
.fhero.has-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 24px 56px; align-items: start; }
.fhero.has-pick .tool { grid-column: 1 / -1; }
.fhero-t .tool-note { margin-top: 16px; }
.fhero .lead { max-width: 62ch; }

/* the answer: one platform (or one pair), one number, one button */
.pick { background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 20px 24px 22px; border-top: 4px solid var(--brass); }
.pick .pick-k { font: 600 .9375rem/1.4 var(--body); letter-spacing: 0; color: var(--text-2); }
.pick-v { margin-top: 8px; }
.pick-v .pick-name { display: block; font: 700 1.25rem/1.25 var(--display); font-stretch: 108%; }
.pick-n { display: block; font: 700 1.75rem/1.2 var(--display); font-stretch: 104%; font-variant-numeric: tabular-nums; }
.pick-d { margin-top: 6px; font-size: .9375rem; color: var(--text-2); }
.pick .cta { display: inline-flex; align-items: center; justify-content: center; margin-top: 14px; }
.pick-alt { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .9375rem; }
.pick-legs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.pick-legs li { display: grid; gap: 6px; }
.pick-leg { color: var(--text-2); }
.pick-legs .side-tag { margin: 0 2px 0 0; }
.pick-legs .pick-name { font: 700 1.125rem/1.3 var(--display); font-stretch: 108%; color: var(--ink); }
.pick-legs .cta { margin: 0; justify-self: start; min-height: 44px; padding: 0 18px; font-size: .9375rem; }
.pick .pick-v.pick-n { margin-top: 16px; display: block; }

.f-gain { color: #1f6b4f; } .f-cost { color: #8a3b1f; }

/* the form */
.tool { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) auto; margin-top: 24px; background: var(--paper); border-radius: var(--r); padding: 8px; }
.fhero.has-pick .tool { margin-top: 0; }
.tool-hedge { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; }
.tool datalist + .field { border-left: 1px solid var(--line); border-radius: 0 4px 4px 0; }
.tool button { align-self: stretch; }
.tool-note { margin-top: 12px; color: var(--sea-text); font-size: .9375rem; max-width: 90ch; }

.tool-err { grid-column: 1 / -1; order: 5; margin-top: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--brass-pale); color: var(--ink); max-width: none; }
.tool-err a { color: var(--petrol-mid); font-weight: 600; }
.fbar { display: flex; flex-wrap: wrap; gap: 0 40px; }

/* the table */
.ftab-wrap { padding: 0 0 8px; }
.ftab { width: 100%; }
.ftab thead th { font-size: .875rem; font-weight: 400; line-height: 1.3; color: var(--text-2); vertical-align: bottom; padding: 0 0 8px 16px; }
.ftab tbody td, .ftab tbody th { padding: 12px 0 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 1rem; }
.ftab tbody tr:hover { background: var(--mist); }
.ftab tbody .best, .ftab tbody .best:hover { background: var(--best); }
.ftab tbody .best td, .ftab tbody .best th, .ftab tbody .best + tr td, .ftab tbody .best + tr th { border-top-color: transparent; }
.ftab .rank { width: 48px; }
.ftab th[scope="row"] .what { display: block; }
.ftab .total strong { display: block; font: 700 1.125rem/1.3 var(--display); font-stretch: 104%; font-variant-numeric: tabular-nums; }
.ftab .total > span { display: block; font-size: .8125rem; color: var(--text-2); }
.ftab td.num { font-variant-numeric: tabular-nums; }
.ftab .act { width: 1%; padding-right: 12px; }
.ftab thead th:last-child, .ftab tbody td:last-child { padding-right: 16px; }
.ftab-rest { margin: 0 8px; }
.ftab-rest .ftab thead { display: none; }
.ftab .act a { white-space: nowrap; }

/* points programme */
.pts { font-size: .875rem; line-height: 1.4; width: 34%; }
.pts b, .pts .pt-when { display: block; }
.pts b { font-weight: 600; font-size: .9375rem; margin-top: 4px; }
.pts .pt-when { color: var(--text-2); }
.st { display: inline-block; padding: 1px 8px; border-radius: 3px; font: 700 .75rem/1.5 var(--display); font-stretch: 108%; letter-spacing: .02em; border: 1px solid transparent; }
.st-running { background: #d3ebe1; color: #1f6b4f; border-color: #a9d3c1; }
.st-ended { background: var(--mist); color: var(--text-2); border-color: var(--line); }
.st-none { background: transparent; color: var(--text-2); border-color: var(--line); font-weight: 600; }
.pt-more { margin-top: 2px; }
.pt-more summary { cursor: pointer; color: var(--petrol-mid); font-weight: 600; width: max-content; padding: 2px 0; }
.pt-more summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.pt-more p { color: var(--text-2); margin-top: 4px; max-width: 46ch; }

/* hedge legs: each leg has its own button */
.leg span { display: block; }
.leg .what { font-size: .875rem; color: var(--text-2); }
.side-tag { display: inline-block; margin-bottom: 4px; padding: 2px 8px; border-radius: 3px; font: 700 .75rem/1.4 var(--display); font-stretch: 108%; letter-spacing: .02em; color: var(--ink); }
.leg .side-tag { display: inline-block; }
.side-long { background: #d3e6e2; } .side-short { background: var(--brass-pale); border: 1px solid #e8d49e; }
.best .side-long { background: #ffffff; }
.leg .leg-act { margin-top: 8px; }
.leg-act a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--petrol-mid); border-radius: 4px; background: var(--paper); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.leg-act a:hover, .best .leg-act a { background: var(--petrol); border-color: var(--petrol); color: #ffffff; }
.best .leg-act a:hover { background: var(--petrol-mid); }
.htab .leg { width: 27%; padding-right: 12px; }

.ftab-more { padding: 8px 16px; font-size: .9375rem; color: var(--text-2); max-width: none; }
.ftab-more b { color: var(--ink); font-weight: 600; }

.fhow { margin-top: 48px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.fhow summary { font-size: 1rem; }
.fhow dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 48px; padding: 4px 0 16px; font-size: .9375rem; }
.fhow dd { color: var(--text-2); }
.tool-x { margin-top: 32px; font-weight: 600; }

@media (max-width: 1120px) {
  .fhero.has-pick { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 24px 32px; }
  .tool, .tool-hedge { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 4px 0; }
  .tool .t-asset { grid-column: 1 / -1; }
  .tool .field { border-top: 1px solid var(--line); }
  .tool .t-asset { border-top: 0; }
  .tool datalist + .field { border-left: 0; }
  .tool button { grid-column: 1 / -1; margin: 4px 0 0; min-height: 52px; }
  .tool-farm .field:nth-of-type(4) { border-left: 1px solid var(--line); }
  .tool-hedge .f-fund { grid-column: auto; }
}
@media (max-width: 860px) {
  /* on a phone the answer comes straight after the question; the note on counting moves under the form */
  .fhero.has-pick { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .fhero.has-pick .fhero-t { display: contents; }
  .fhero.has-pick h1 { order: 1; } .fhero.has-pick .lead { order: 2; } .fhero.has-pick .pick { order: 3; margin-top: 20px; }
  .fhero.has-pick .tool { order: 4; margin-top: 16px; } .fhero.has-pick .tool-note { order: 5; margin-top: 12px; }
  .fhow dl { grid-template-columns: minmax(0, 1fr); }
  .ftab, .ftab tbody { display: block; }
  .ftab thead { display: none; }
  .ftab tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; position: relative; padding: 16px 12px 16px 56px; border-top: 1px solid var(--line); }
  .ftab tbody .best { border-radius: 4px; }
  .ftab tbody .best, .ftab tbody .best + tr { border-top-color: transparent; }
  .ftab tbody td, .ftab tbody th { display: block; border: 0; padding: 0; }
  .ftab .rank { position: absolute; left: 12px; top: 16px; width: auto; }
  .ftab tbody th[scope="row"] { grid-column: 1 / -1; }
  .ftab td.num { text-align: left; white-space: normal; }
  .ftab td[data-l]::before { content: attr(data-l); display: block; font-size: .8125rem; line-height: 1.3; color: var(--text-2); }
  .ftab td.act { grid-column: 1 / -1; }
  .ftab .pts { width: auto; }
  .ftab .act { width: auto; padding: 0; }
  .ftab .act a { display: flex; justify-content: center; width: 100%; white-space: normal; text-align: center; }
  .ftab tr:not(.best) .act a { background: var(--mist); border-color: var(--mist); }
  .ftab tr:not(.best) .act a:hover { background: var(--petrol); border-color: var(--petrol); }
  .htab tbody tr { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .htab td.leg { grid-column: span 3; width: auto; padding: 0; }
  .htab td.num { grid-column: span 2; }
  .htab tbody tr:not(:has([data-l="Funding"])) td.num { grid-column: 1 / -1; }
  .leg-act a { width: 100%; justify-content: center; text-align: center; padding: 6px 10px; }
}
@media (max-width: 560px) {
  .tool, .tool-hedge { grid-template-columns: minmax(0, 1fr); }
  .tool .field { border-left: 0; }
  .tool-farm .field:nth-of-type(4) { border-left: 0; }
  .tool-hedge .f-fund { grid-column: 1 / -1; }
  .pick { padding: 16px 16px 18px; }
  .pick-name, .pick-n { font-size: 1.3125rem; }
  .pick .cta { width: 100%; }
  .pick-legs .cta { justify-self: stretch; }
  .fbar { gap: 0; }
  .ftab tbody tr { padding: 14px 10px 14px 48px; gap: 10px 12px; grid-template-columns: minmax(0, 1fr); }
  .ftab .rank { left: 8px; top: 14px; }
  .htab tbody tr { grid-template-columns: repeat(6, minmax(0, 1fr)); padding-left: 10px; padding-top: 54px; }
  .htab .rank { top: 12px; left: 10px; }
}
.ftab .total strong span { display: inline; font-size: inherit; line-height: inherit; }
.ftab .total strong .f-gain { color: #1f6b4f; } .ftab .total strong .f-cost { color: #8a3b1f; }
