/* Perp Strategy — Advanced page. Loaded after simple.css: same black-and-white system, denser layout. */
:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --color-bg: #FAF7F0; --color-panel: #FFFFFF; --color-fg: #12261C; --color-fg-muted: #4E5B52;
  --color-border-line: #E4DDCC; --color-ok: #1C4D35; --color-bad: #9A6B3C; --color-warn: #8A7A55;
  --cds-gap-xs: 4px; --cds-gap-sm: 8px; --cds-gap-md: 16px; --cds-gap-lg: 28px;
  --cds-pad-xs: 4px; --cds-pad-sm: 10px; --cds-pad-lg: 20px;
  --cds-font-size-title: clamp(32px, 5vw, 56px); --cds-font-size-heading: 17px; --cds-font-size-body: 15px; --cds-font-size-caption: 13px;
  --cds-font-weight-medium: 500; --cds-radius: 12px; --cds-dur-slow: 400ms;
  --cds-surface-popover: #FFFFFF; --cds-border: #1C4D35; --cds-shadow-popover: 0 8px 24px rgba(18,38,28,.12);
  --cds-text-secondary: #4E5B52;
  --cds-chart-grid: #ECE6D8; --cds-chart-axis: #848B82; --cds-chart-reference: #4E5B52;
  --cds-chart-status-critical: #B08A5A; --cds-chart-status-warning: #8A7A55;
  color-scheme: light;
}
.site-banner { margin: 16px 0 0; padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--r-sm); color: var(--white); font-size: 13px; }
.site-banner[hidden] { display: none; }
.site-foot { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--g3); color: var(--g2); font-size: 12px; line-height: 1.6; }
.site-foot p { margin: 0 0 6px; }
.dash-select { font: inherit; font-size: 14px; color: var(--white); background: var(--black); border: 1px solid var(--g3); border-radius: 8px; height: 34px; padding: 0 28px 0 10px; }
.dash-select:focus { outline: none; border-color: var(--accent); }
.dash-skeleton:empty { min-height: 4rem; background: linear-gradient(90deg, var(--black), var(--g4), var(--black)); background-size: 200% 100%; animation: ps-shimmer 1.6s infinite linear; }
@keyframes ps-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Page */
.ps { font-family: var(--font-sans); color: var(--color-fg); display: flex; flex-direction: column; gap: var(--cds-gap-lg); }
.ps h1 { color: var(--head); font-weight: 300; font-size: var(--cds-font-size-title); line-height: 1; letter-spacing: -0.04em; margin: 0; text-wrap: balance; }
#top { padding: clamp(40px, 7vw, 88px) 0 0; }
.ps h2 { font-size: var(--cds-font-size-heading); font-weight: var(--cds-font-weight-medium); margin: 0; }
.ps h3 { font-size: var(--cds-font-size-body); font-weight: var(--cds-font-weight-medium); margin: 0; }
.ps-take { margin: var(--cds-gap-xs) 0 0; color: var(--color-fg); max-width: 60rem; line-height: 1.5; }
.ps .ps-take b { font-weight: 600; }
.ps-muted { color: var(--color-fg-muted); font-size: var(--cds-font-size-caption); margin: 0; line-height: 1.5; }
.ps-controls { display: flex; flex-wrap: wrap; gap: var(--cds-gap-md); align-items: end; }
.ps-controls { padding: 18px 0; border-top: 1px solid var(--g3); border-bottom: 1px solid var(--g3); }
.ps-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--g1); }
.ps-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 0; }
.ps-tiles > .ps-card + .ps-card { border-left: 0; }
.ps-card { background: var(--paper); border: 1px solid var(--g3); padding: var(--cds-pad-lg); display: flex; flex-direction: column; gap: var(--cds-gap-sm); min-width: 0; }
.ps-tile-label { font-size: var(--cds-font-size-caption); color: var(--color-fg-muted); }
.ps-big { font-weight: 300; letter-spacing: -0.03em; font-size: var(--cds-font-size-title); font-variant-numeric: tabular-nums; line-height: 1.1; min-height: 1.2em; }
.ps-pos { color: var(--color-ok); }
.ps-neg { color: var(--color-bad); }
.ps-bars { display: flex; flex-direction: column; gap: 6px; position: relative; min-height: 14rem; }
.ps-bar-row { display: grid; grid-template-columns: minmax(8rem, 15rem) 1fr 4.5rem; gap: var(--cds-gap-sm); align-items: center; font-size: var(--cds-font-size-caption); }
.ps-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-bar-track { height: 18px; position: relative; }
.ps-bar { position: absolute; top: 0; bottom: 0; }
.ps-bar-val { text-align: right; font-variant-numeric: tabular-nums; }
.ps-tip { position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--g3); border-radius: 8px; box-shadow: 0 8px 24px rgba(18,38,28,.12); padding: var(--cds-pad-xs) var(--cds-pad-sm); font-size: var(--cds-font-size-caption); z-index: 2; white-space: nowrap; }
.ps-tip-head { color: var(--cds-text-secondary); margin-bottom: 2px; }
.ps-table-wrap { max-height: 34rem; overflow: auto; }
.ps table { width: 100%; border-collapse: collapse; font-size: var(--cds-font-size-caption); font-variant-numeric: tabular-nums; }
.ps th { position: sticky; top: 0; background: var(--paper); font-weight: 500; text-align: right; font-weight: var(--cds-font-weight-medium); color: var(--color-fg-muted); padding: 6px 8px; border-bottom: 1px solid var(--color-border-line); white-space: nowrap; }
.ps th.ps-l, .ps td.ps-l { text-align: left; }
.ps td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--color-border-line); white-space: nowrap; }
.ps th button { all: unset; cursor: pointer; }
.ps th[aria-sort="descending"] button::after { content: " ↓"; }
.ps th[aria-sort="ascending"] button::after { content: " ↑"; }
.ps-search { font: inherit; height: 34px; padding: 0 10px; border: 1px solid var(--g3); border-radius: 8px; background: var(--paper); color: var(--color-fg); min-width: 12rem; }
.ps-row-head { display: flex; flex-wrap: wrap; gap: var(--cds-gap-md); align-items: center; justify-content: space-between; }
.ps-heat { display: grid; gap: 2px; font-size: var(--cds-font-size-caption); font-variant-numeric: tabular-nums; position: relative; min-height: 10rem; }
.ps-heat-cell { position: relative; padding: 5px 8px; text-align: right; overflow: hidden; }
.ps-heat-cell > span { position: relative; }
.ps-heat-fill { position: absolute; inset: 0; }
.ps-heat-head { color: var(--color-fg-muted); padding: 5px 8px; text-align: right; }
.ps-heat-asset { padding: 5px 8px; text-align: left; }
.ps-tabs { display: inline-flex; margin-top: 28px; flex-wrap: wrap; border: 1px solid var(--g3); }
.ps-tab { font: inherit; font-size: 14px; height: 38px; padding: 0 16px; border: 0; background: transparent; color: var(--g1); cursor: pointer; }
.ps-tab + .ps-tab { border-left: 1px solid var(--g3); }
.ps-tab:hover { color: var(--white); }
.ps-tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); font-weight: 500; }
.ps-page { display: flex; flex-direction: column; gap: var(--cds-gap-lg); }
.ps-page[hidden] { display: none; }
.ps-verdict { margin: 0; line-height: 1.55; }
.ps-verdict[hidden] { display: none; }
.ps-chart { position: relative; min-height: 262px; }
.ps-chart svg text { fill: var(--color-fg-muted); font-size: var(--cds-font-size-caption); }
.ps-legend { display: flex; gap: var(--cds-gap-md); flex-wrap: wrap; font-size: var(--cds-font-size-caption); color: var(--color-fg-muted); margin-bottom: 4px; }
.ps-sw { display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; }
.ps tr.ps-pick { cursor: pointer; }
.ps tr.ps-sel td { background: var(--cds-chart-grid); }
.ps-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: var(--cds-gap-sm); min-height: 12rem; }
.ps-mini { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--g3); min-width: 0; }
.ps-mini:hover, .ps-mini:focus-visible { border-color: var(--accent); }
.ps-mini.ps-sel { border-color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
.ps-mini-head { display: flex; justify-content: space-between; gap: var(--cds-gap-sm); align-items: baseline; font-size: var(--cds-font-size-caption); }
.ps-mini-title { font-weight: var(--cds-font-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-mini-tag { white-space: nowrap; color: var(--color-fg-muted); }
.ps-tag-never { color: var(--color-bad); }
.ps-tag-rarely { color: var(--cds-chart-status-warning, var(--color-fg-muted)); }
.ps-mini-foot { font-size: var(--cds-font-size-caption); color: var(--color-fg-muted); line-height: 1.4; }
.ps-faq { display: flex; flex-direction: column; gap: 0; }
.ps-faq details { border-bottom: 1px solid var(--color-border-line); padding: var(--cds-pad-sm) 0; }
.ps-faq details:last-child { border-bottom: 0; }
.ps-faq summary { cursor: pointer; font-weight: 500; padding: 4px 0; }
.ps-faq p, .ps-faq ul { margin: var(--cds-gap-sm) 0 0; color: var(--color-fg-muted); line-height: 1.55; max-width: 60rem; }
.ps-faq ul { padding-left: 1.2rem; }
[data-dash-source-state=empty] { color: transparent; }
[data-dash-source-state=refreshing] { opacity: .5; transition: opacity var(--cds-dur-slow); }

.ps h2 { letter-spacing: -0.01em; }
.ps section > h2:first-child, .ps-card > h2:first-child { margin-bottom: 2px; }
.ps-tag-never { color: #9A6B3C; text-decoration: underline; }
.ps-pos { color: var(--accent); font-weight: 500; }
.ps-neg { color: var(--g1); }
.ps-pos::before { content: ""; }
.ps tr:hover td { background: var(--g4); }
.ps tr.ps-sel td { background: var(--g4); box-shadow: inset 2px 0 0 var(--accent); }
.ps-lead { margin: 18px 0 0; color: var(--g1); font-size: clamp(16px, 1.7vw, 19px); max-width: 60ch; line-height: 1.5; }
.site-foot .legal-links a { color: var(--g1); }
.ps-venues { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border-top: 1px solid var(--g3); border-left: 1px solid var(--g3); margin-top: 12px; }
.ps-venue { padding: 18px 18px 12px; border-right: 1px solid var(--g3); border-bottom: 1px solid var(--g3); display: flex; flex-direction: column; gap: 2px; }
.ps-venue-name { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.ps-venue-chain { font-size: 13px; color: var(--g2); margin-bottom: 10px; }
.ps-venue dl { margin: 0; }
.ps-venue dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--g3); font-size: 14px; }
.ps-venue dt { color: var(--g2); }
.ps-venue dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.ps-row-head .ps-mini-search { margin-left: auto; width: 260px; max-width: 100%; }
/* light theme */
.ps-card { border-radius: var(--r); }
.ps-tiles { gap: 12px; } .ps-tiles > .ps-card + .ps-card { border-left: 1px solid var(--g3); }
.ps-tabs { border-radius: var(--r-sm); overflow: hidden; background: var(--paper); }
.ps-mini { background: var(--paper); border-radius: 12px; }
.ps-table-wrap { border: 1px solid var(--g3); border-radius: var(--r); background: var(--paper); }
.ps-heat-cell > span { color: var(--white); }
