/* ==========================================================================
   GLS Equity - the wheel position-size calculator (1 Nov 2026)
   Used by /position-size (free page) and the Journal's Sizing tab. Markup from position-size.js (window.GLS_SIZER).
   ========================================================================== */
.ps { display: grid; gap: 16px; container: ps / inline-size; }
.ps-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; min-width: 0; }
.ps-h { margin: 0 0 14px; font-size: 1.15rem; font-weight: 800; color: #0f172a; }
.ps-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 16px; align-items: end; }   /* a two-line label keeps its box level with the others */
.ps-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; font-weight: 700; color: #334155; min-width: 0; }
.ps-field-wide { grid-column: 1 / -1; max-width: 340px; }
.ps-box { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 0 10px; min-height: 44px; }
.ps-box:focus-within { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.ps-box b { color: #64748b; font-weight: 700; }
.ps-box input { border: 0; outline: none; font: inherit; font-size: 1.05rem; font-weight: 800; width: 100%; min-width: 0; padding: 8px 0; background: transparent; color: #0f172a; font-variant-numeric: tabular-nums; }
.ps-note { display: block; font-size: 0.85rem; font-weight: 500; color: #64748b; line-height: 1.4; }
.ps-basis { border: 0; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.ps-basis legend { font-size: 0.92rem; font-weight: 700; color: #334155; margin-bottom: 6px; padding: 0; }
.ps-basis label { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 8px; align-items: start; font-size: 0.95rem; color: #334155; line-height: 1.45; cursor: pointer; }
/* 1 Nov 2026 (George: the radio sat off the Margin line): the radio centred on the first text line (line-height 1.45 × 0.88rem ≈ 20px), the % box on its own line under the words */
.ps-basis input[type="radio"] { width: 16px; height: 16px; margin: 3px 0 0; accent-color: #10b981; }
.ps-basis small { color: #64748b; }
.ps-inline { width: 60px; margin: 0 4px; padding: 4px 6px; min-height: 32px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-weight: 700; text-align: right; }
.ps-save { background: #10b981; color: #fff; border: 1px solid #10b981; border-radius: 8px; padding: 9px 16px; font: inherit; font-size: 0.9rem; font-weight: 800; cursor: pointer; min-height: 40px; }
.ps-save:hover { background: #059669; border-color: #059669; }
.ps-save:disabled { opacity: 0.6; cursor: default; }
.ps-save-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.ps-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ps-res { display: flex; flex-direction: column; row-gap: 6px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; }
.ps-res-label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #64748b; }
.ps-res-val { font-size: 1.5rem; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.ps-res-sub { font-size: 1.02rem; color: #334155; line-height: 1.45; }   /* 1 Nov 2026 (George): bigger, the numbers in green bold */
.ps-res-sub b { color: #047857; font-weight: 800; }
.ps-warn { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; font-size: 0.95rem; line-height: 1.5; }
.ps-empty { margin: 0; color: #64748b; font-size: 0.9rem; }
.ps-need-row { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; margin-bottom: 14px; }
.ps-need-row .ps-field { width: 220px; max-width: 100%; }
.ps-need { flex: 1 1 260px; font-size: 1rem; color: #334155; line-height: 1.5; }
.ps-big { font-size: 1.25rem; color: #047857; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.ps-table th { text-align: right; font-size: 0.78rem; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.ps-table td { text-align: right; padding: 9px 10px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.ps-table th:first-child, .ps-table td:first-child { text-align: left; }
.ps-usage-head { margin: 0 0 6px; font-size: 1rem; color: #334155; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ps-usage-next { margin: 0 0 12px; font-size: 1rem; color: #334155; }
.ps-usage-next b { color: #047857; }
.ps-bar { display: inline-block; width: 120px; height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; vertical-align: middle; }
.ps-bar i { display: block; height: 100%; background: #10b981; border-radius: 999px; }
.ps-bar i.is-near { background: #f59e0b; }
.ps-bar i.is-over { background: #dc2626; }
.ps-bar-cell { text-align: left !important; }
.ps-over { color: #b91c1c; }
.ps-usage tr.is-over td { background: #fef2f2; }
.ps-sector { font-weight: 700; color: #0f172a; }
@media (max-width: 768px) {
    .ps-card { padding: 16px 12px; }   /* the page gutter already insets it on phones, so it keeps its border */
    .ps-field-wide { max-width: none; }
    .ps-bar { width: 80px; }
}

/* the free page around it (/position-size) */
.psz-page { max-width: 1320px; }
.psz-hero { padding: 8px 0 16px; }
.psz-eyebrow { display: inline-block; margin: 0 0 10px; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; border-radius: 999px; padding: 4px 12px; font-size: 0.8rem; font-weight: 700; }
.psz-hero .page-title { margin: 0 0 8px; }
.psz-lead { margin: 0; font-size: 1.08rem; line-height: 1.6; color: #334155; max-width: 780px; }
.psz-text { margin-top: 18px; }
.psz-text h2 { margin: 0 0 8px; font-size: 1.2rem; }
.psz-text p, .psz-text li { color: #334155; line-height: 1.6; }
.psz-text ul { padding-left: 20px; }
.psz-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
@media (max-width: 768px) { .psz-lead { font-size: 1rem; } .psz-text.panel-card { padding: 20px 16px; } }
.psz-text h3 { margin: 18px 0 6px; font-size: 1.05rem; }
.psz-text .table-responsive { max-width: 640px; margin: 8px 0 14px; }   /* the site's bordered table box sized to the table */
.psz-streak { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; margin: 0; }
.psz-streak th, .psz-streak td { padding: 7px 10px; border-bottom: 1px solid #e2e8f0; text-align: right; white-space: nowrap; }
.psz-streak th:first-child, .psz-streak td:first-child { text-align: left; }
.psz-streak thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; border-bottom: 2px solid #e2e8f0; }
.psz-streak tbody tr:last-child td { border-bottom: 0; }
.psz-streak .is-hi { background: #ecfdf5; font-weight: 800; color: #047857; }
.psz-streak .dn { color: #b91c1c; font-weight: 700; }
.psz-btn-alt { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; font-weight: 700; }
.psz-btn-alt:hover { background: #d1fae5; border-color: #10b981; color: #065f46; }
@media (max-width: 768px) { .psz-streak thead th { white-space: normal; vertical-align: bottom; } .psz-streak th, .psz-streak td { padding: 7px 8px; } }   /* all three columns on a phone, no sideways scroll */

/* the Journal's Sizing tab (1 Nov 2026, George: "very hard to read" on a wide screen): one readable column, not stretched across the page */
#sizing-container { max-width: 1120px; margin-left: auto; margin-right: auto; }   /* centred under the tabs; only this tab, the others keep the full width */
#sizing-container .sizing-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 6px 0 16px; }
#sizing-container .sizing-intro { flex: 1 1 520px; font-size: 1rem; line-height: 1.6; color: #475569; margin: 0; max-width: 820px; }
#sizing-container .sizing-intro strong { color: #0f172a; }
.sizing-why-btn { flex: 0 0 auto; padding: 9px 14px; border: 1px solid #6ee7b7; border-radius: 8px; background: #ecfdf5; color: #047857; font: inherit; font-size: 0.92rem; font-weight: 800; cursor: pointer; }
.sizing-why-btn:hover { background: #d1fae5; border-color: #10b981; }
/* the slide-out */
.ps-drawer { position: fixed; inset: 0; z-index: 2500; }
.ps-drawer[hidden] { display: none; }
.ps-drawer-back { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.35); opacity: 0; transition: opacity 0.2s; }
.ps-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); overflow-y: auto; background: #fff; box-shadow: -8px 0 30px rgba(15, 23, 42, 0.2); padding: 22px 22px 30px; transform: translateX(100%); transition: transform 0.2s ease; }
.ps-drawer.is-open .ps-drawer-back { opacity: 1; }
.ps-drawer.is-open .ps-drawer-panel { transform: none; }
.ps-drawer-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: #f1f5f9; color: #334155; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.ps-drawer .ps-why-h { padding-right: 40px; }
#sizing-container .ps-card { padding: 20px 22px; }
#sizing-container .ps-bar { width: 160px; }
@media (max-width: 768px) { #sizing-container .ps-card { padding: 16px 12px; } #sizing-container .ps-bar { width: 80px; } #sizing-container .sizing-intro { font-size: 0.95rem; } }

/* 1 Nov 2026 (George): "What these limits allow" sits in the account card, to the right of the inputs; the warning along the bottom of it */
.ps-main-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 24px; }
.ps-allow { border-left: 1px solid #e2e8f0; padding-left: 24px; min-width: 0; }
.ps-allow .ps-results { grid-template-columns: 1fr; gap: 10px; }
.ps-allow .ps-res { padding: 12px 14px; row-gap: 4px; }
.ps-allow .ps-res-val { font-size: 1.4rem; }
.ps-main .ps-warn { margin-top: 16px; }
@container ps (max-width: 820px) {   /* by the calculator's own width - the free page has a sidebar beside it */
    .ps-main-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .ps-allow { border-left: 0; padding-left: 0; border-top: 1px solid #e2e8f0; padding-top: 16px; }
    .ps-allow .ps-results { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}

/* ---- 1 Nov 2026 (George: risk limits, margin wording, small charts, "why risk matters" beside it) ---- */
/* the margin box (1 Nov 2026, George): shown only with a margin account - a labelled field like the others, the help under it, then the warning */
.ps-margin-box { margin: 2px 0 0 26px; padding-left: 14px; border-left: 3px solid #e2e8f0; }
.ps-margin-box[hidden] { display: none; }
.ps-margin-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }   /* Margin Amt: [20 %] help - one line, wraps on a phone */
.ps-basis label.ps-margin-lbl { display: inline; cursor: default; font-size: 0.92rem; font-weight: 700; color: #334155; }
.ps-margin-pct { min-height: 38px; padding: 0 10px; }
.ps-margin-pct input { width: 2.2em; flex: 0 0 auto; padding: 6px 0; font-size: 1rem; }
.ps-margin-help { flex: 1 1 200px; min-width: 0; font-size: 0.82rem; color: #64748b; line-height: 1.45; }
.ps-margin-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #fffbeb; border: 1px solid #fbbf24; border-left: 4px solid #f59e0b; color: #78350f; font-size: 0.9rem; line-height: 1.5; }
.ps-margin-note b { color: #92400e; }
.ps-res-held { font-size: 0.85rem; color: #64748b; line-height: 1.4; }
.ps-chart { min-width: 0; }
.ps-chart-h { margin: 0 0 2px; font-size: 0.95rem; font-weight: 800; color: #0f172a; }
.ps-chart-cap { margin: 0 0 10px; font-size: 0.92rem; color: #475569; line-height: 1.5; }
.ps-chart-cap b { color: #047857; font-weight: 800; }
/* the small pie on each risk card */
.ps-res { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-content: start; }
.ps-res > :not(.ps-pie) { grid-column: 1; }
.ps-pie { grid-column: 2; grid-row: 1 / span 4; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ps-pie svg { width: 52px; height: 52px; display: block; }
.ps-pie b { font-size: 0.8rem; font-weight: 800; color: #475569; font-variant-numeric: tabular-nums; }
.ps-pie .rest { fill: #e2e8f0; }
.ps-pie .part { fill: #10b981; }
.ps-pie .slice { fill: none; stroke: #10b981; stroke-width: 16; }
.ps-keys { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 0.85rem; color: #475569; }
.ps-key { display: inline-flex; align-items: center; gap: 6px; }
.ps-key i { width: 12px; height: 12px; }
.ps-key i { display: block; border-radius: 3px; background: #e2e8f0; }
.ps-key .fit { background: #10b981; }
.ps-key .nofit { background: #cbd5e1; }
.ps-key .acct { width: 16px; height: 0; border-top: 2px solid #0f172a; border-radius: 0; aspect-ratio: auto; background: none; }
/* charts (SVG) */
.ps-chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; }
.ps-chart svg .g { stroke: #e2e8f0; stroke-width: 1; }
.ps-chart svg .ax { fill: #64748b; font-size: 11px; }
.ps-chart svg .xh { stroke: #94a3b8; stroke-width: 1; }
.ps-chart svg .hit { fill: transparent; }
.ps-streak svg { max-width: 420px; }
.ps-streak .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ps-streak .ln.you { stroke: #059669; stroke-width: 3; }
.ps-streak .ln.c1 { stroke: #64748b; stroke-dasharray: 6 4; }
.ps-streak .ln.c2 { stroke: #94a3b8; stroke-dasharray: 2 4; }
.ps-streak .lbl { font-size: 11px; font-weight: 700; fill: #475569; }
.ps-streak .lbl.you { fill: #047857; }
.ps-strikes svg { max-width: 640px; }
.ps-strikes .bar.fit { fill: #10b981; }
.ps-strikes .bar.nofit { fill: #cbd5e1; }
.ps-strikes .bar:hover { opacity: 0.8; }
.ps-strikes .acct { stroke: #0f172a; stroke-width: 2; }
.ps-strikes .acct-l { fill: #0f172a; font-size: 12px; font-weight: 700; }
.ps-numbers { margin-top: 12px; }
.ps-numbers summary { cursor: pointer; font-size: 0.9rem; font-weight: 700; color: #047857; }
.ps-numbers .table-responsive { margin-top: 8px; }
/* the hover tooltip */
.ps-tip { position: fixed; z-index: 3000; max-width: 300px; padding: 7px 10px; border-radius: 8px; background: #0f172a; color: #fff; font-size: 0.82rem; line-height: 1.45; pointer-events: none; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25); }
.ps-tip[hidden] { display: none; }
/* Journal: sector bars on one scale, the limit marked */
.ps-sbar { position: relative; display: block; width: 240px; max-width: 100%; height: 12px; border-radius: 4px; background: #f1f5f9; }
.ps-sbar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; }
.ps-sbar i.ok { background: #10b981; }
.ps-sbar i.over { background: #dc2626; border-radius: 0 4px 4px 0; }
.ps-sbar .lim { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #0f172a; }
.ps-lim-key { display: inline-block; width: 2px; height: 11px; background: #0f172a; vertical-align: -1px; margin-left: 4px; }
/* "Why risk management matters" - the free page's sidebar and the Journal's slide-out */
.ps-why h2.ps-why-h { margin: 0 0 8px; font-size: 1.15rem; font-weight: 800; color: #0f172a; }
.ps-why h3 { margin: 16px 0 6px; font-size: 0.98rem; font-weight: 800; color: #0f172a; }
.ps-why p, .ps-why li { color: #334155; font-size: 0.93rem; line-height: 1.6; }
.ps-why p { margin: 0 0 8px; }
.ps-why ul { margin: 0; padding-left: 18px; }
.ps-why li { margin-bottom: 6px; }
.ps-why .ps-why-small { margin-top: 10px; font-size: 0.88rem; color: #475569; }
@media (max-width: 768px) {
    .ps-sbar { width: 120px; }
    .ps-margin-box { margin-left: 4px; padding-left: 12px; }
}

/* the free page: calculator + "Why risk management matters" sidebar (1 Nov 2026) */
.psz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-areas: "main side"; gap: 20px; align-items: start; }
.psz-main { grid-area: main; min-width: 0; }
.psz-side { grid-area: side; position: sticky; top: 84px; min-width: 0; max-height: calc(100vh - 100px); overflow-y: auto; border-radius: 12px; scrollbar-width: thin; }   /* its own scroll bar when it is taller than the window */
.psz-side-body.panel-card { padding: 20px; margin: 0; }
.psz-side-toggle { display: none; }
.psz-hero { max-width: 1000px; }
@media (max-width: 1180px) {
    .psz-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; gap: 14px; }
    .psz-side { position: static; max-height: none; overflow: visible; }
    .psz-side-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid #a7f3d0; border-radius: 10px; background: #ecfdf5; color: #047857; font: inherit; font-size: 0.98rem; font-weight: 800; cursor: pointer; text-align: left; }
    .psz-side-toggle span { transition: transform 0.2s; }
    .psz-side.is-open .psz-side-toggle span { transform: rotate(180deg); }
    .psz-side-body { display: none; }
    .psz-side.is-open .psz-side-body { display: block; margin-top: 10px; }
    .psz-side .ps-why-h { display: none; }   /* the button already says it */
}
