/* =================================================================
   portfolio.css — The Compound Family
   Styles for portfolio.html (extracted from inline <style> block).
================================================================= */

/* ── Layout ──────────────────────────────────────────────────── */
.pf-page { max-width: 1280px; margin: 0 auto; padding: 28px 20px 80px; }
.pf-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.pf-header-left h1 { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -.5px; margin: 0 0 3px; }
.pf-header-left p { font-size: 13px; color: var(--text2); margin: 0; }
.pf-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Metric strip ────────────────────────────────────────────── */
.pf-metrics { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 16px; }
@media(max-width:1100px){ .pf-metrics { grid-template-columns: repeat(4,1fr); } }
@media(max-width:700px){ .pf-metrics { grid-template-columns: repeat(2,1fr); } }
.pf-metric { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.pf-metric-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.pf-metric-val { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.1; }
.pf-metric-sub { font-size: 11px; color: var(--text2); margin-top: 3px; }

/* ── Dashboard row ───────────────────────────────────────────── */
.pf-dash { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.pf-dash > .pf-risk-engine { grid-column: 1 / -1; }
.pf-dash-col { display: flex; flex-direction: column; gap: 14px; }
@media(max-width:900px){ .pf-dash { grid-template-columns: 1fr; } }
.pf-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.pf-card-title { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); margin: 0 0 14px; }

/* ── Score circle ────────────────────────────────────────────── */
.pf-score-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.pf-circle { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--score-col, var(--border)); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface2); }
.pf-circle-num { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.pf-circle-max { font-size: 10px; color: var(--text2); }
.pf-score-label { font-size: 16px; font-weight: 700; }
.pf-score-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.pf-score-val { font-size: 13px; font-weight: 600; margin-top: 5px; }

/* ── Factor bars ─────────────────────────────────────────────── */
.pf-frow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pf-frow:last-child { margin-bottom: 0; }
.pf-fname { font-size: 11px; color: var(--text2); width: 120px; flex-shrink: 0; }
.pf-fbar-bg { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.pf-fbar { height: 5px; border-radius: 3px; transition: width .5s ease; }
.pf-fscore { font-size: 12px; font-weight: 600; width: 26px; text-align: right; flex-shrink: 0; }

/* ── Altman Z ────────────────────────────────────────────────── */
.pf-altman { display: flex; align-items: center; gap: 10px; padding: 10px 0 0; border-top: 1px solid var(--border); margin-top: 12px; }
.pf-altman-label { font-size: 10px; color: var(--text2); display: block; }
.pf-altman-val { font-size: 12px; font-weight: 600; }

/* ── Sector bars ─────────────────────────────────────────────── */
.pf-srow { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.pf-sdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pf-sname { font-size: 12px; color: var(--text2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-sbar-bg { width: 70px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.pf-sbar { height: 4px; border-radius: 2px; }
.pf-spct { font-size: 12px; font-weight: 600; width: 34px; text-align: right; flex-shrink: 0; }
.pf-warn { display: flex; align-items: center; gap: 8px; font-size: 11px; padding: 7px 10px; background: var(--amber-dim); border: 1px solid var(--amber-border); border-radius: 6px; color: var(--amber); margin-bottom: 10px; }
.pf-benchmark-note { font-size: 10px; color: var(--text2); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); line-height: 1.4; }
.pf-benchmark-stale { color: var(--amber); font-weight: 600; }

/* ── Insights ────────────────────────────────────────────────── */
.pf-insight { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 7px; margin-bottom: 8px; background: var(--surface2); border: 1px solid var(--border); }
.pf-insight:last-child { margin-bottom: 0; }
.pf-insight.weak { border-left: 3px solid var(--red); }
.pf-insight.strong { border-left: 3px solid var(--accent); }
.pf-insight.warn { border-left: 3px solid var(--amber); }
.pf-insight-lbl { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); margin-bottom: 2px; }
.pf-insight-msg { font-size: 12px; color: var(--text); line-height: 1.4; }

/* ── AI Analysis card ────────────────────────────────────────── */
.pf-ai-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; background: var(--accent-dim); border: 1px solid var(--accent-border); border-radius: 8px; cursor: pointer; transition: background .15s; margin-bottom: 10px; }
.pf-ai-btn:hover { background: rgba(63,185,80,.18); }
.pf-ai-btn:disabled { opacity: .4; cursor: default; }
.pf-ai-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.pf-ai-title { font-size: 13px; font-weight: 600; color: var(--accent); }
.pf-ai-sub { font-size: 11px; color: var(--text2); }
.pf-ai-badge { font-size: 10px; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; margin-left: auto; flex-shrink: 0; }
.pf-ai-result { font-size: 13px; color: var(--text); line-height: 1.6; padding: 10px 0; border-top: 1px solid var(--border); margin-top: 8px; max-height: 520px; overflow-y: auto; }
.pf-ai-result p { margin: 0 0 8px; }
.pf-ai-result p:last-child { margin-bottom: 0; }
.pf-ai-result strong { font-weight: 700; color: var(--text); }
.pf-ai-limit { font-size: 11px; color: var(--text2); line-height: 1.5; }
.pf-ai-upgrade { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--accent); text-decoration: none; }

/* ── Free banner ─────────────────────────────────────────────── */
.pf-free-banner { display: none; align-items: center; gap: 14px; padding: 14px 18px; background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pf-free-banner-text { flex: 1; font-size: 13px; }
.pf-free-banner-text strong { color: var(--gold); }

/* ── Table controls ──────────────────────────────────────────── */
.pf-tbl-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pf-tbl-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.pf-tbl-title { font-size: 14px; font-weight: 700; color: var(--text); }
.pf-tbl-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── View tabs ───────────────────────────────────────────────── */
.pf-view-tabs { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.pf-view-tab { font-size: 12px; font-weight: 500; padding: 5px 12px; cursor: pointer; color: var(--text2); background: none; border: none; transition: all .15s; white-space: nowrap; }
.pf-view-tab.active { background: var(--accent); color: #fff; }
.pf-view-tab:hover:not(.active) { color: var(--text); }

/* ── Table ───────────────────────────────────────────────────── */
.pf-tbl-scroll { overflow-x: auto; }
table.pf-tbl { width: 100%; border-collapse: collapse; min-width: 700px; }
table.pf-tbl th { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; user-select: none; }
table.pf-tbl th.sortable { cursor: pointer; }
table.pf-tbl th.sortable:hover { color: var(--text); }
table.pf-tbl th.r, table.pf-tbl td.r { text-align: right; }
table.pf-tbl td { font-size: 13px; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
table.pf-tbl tr:last-child td { border-bottom: none; }
table.pf-tbl tr:hover td { background: var(--surface2); }
.sort-arrow { font-size: 9px; margin-left: 3px; opacity: .5; }
.sort-arrow.active { opacity: 1; color: var(--accent); }

/* ── Ticker cell ─────────────────────────────────────────────── */
.pf-ticker-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.pf-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; background: var(--surface2); flex-shrink: 0; }
.pf-logo-ph { width: 28px; height: 28px; border-radius: 6px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text2); flex-shrink: 0; }
.pf-tick { font-size: 13px; font-weight: 700; color: var(--text); text-decoration: none; display: block; line-height: 1; }
.pf-tick:hover { color: var(--accent); }
.pf-tick-name { font-size: 10px; color: var(--text2); }
.pf-tick-sector { font-size: 10px; color: var(--text2); }

/* ── Score pill ──────────────────────────────────────────────── */
.pf-score-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 22px; border-radius: 4px; font-size: 13px; font-weight: 700; padding: 0 5px; }
.spill-green { background: var(--accent-dim); color: var(--accent); }
.spill-amber { background: var(--amber-dim); color: var(--amber); }
.spill-red { background: var(--red-dim); color: var(--red); }
.spill-neutral { background: var(--surface2); color: var(--text2); }

/* ── Momentum arrow ──────────────────────────────────────────── */
.pf-mom { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.pf-mom-arrow { font-size: 14px; line-height: 1; }
.pf-mom-val { font-size: 12px; font-weight: 600; }
.pf-mom-lbl { font-size: 10px; color: var(--text2); }

/* ── Weight bar ──────────────────────────────────────────────── */
.pf-wbar-wrap { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.pf-wbar-bg { width: 48px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pf-wbar { height: 4px; border-radius: 2px; background: var(--blue); }

/* ── PL cell ─────────────────────────────────────────────────── */
.pf-pl-pos { color: var(--accent); }
.pf-pl-neg { color: var(--red); }

/* ── Actions cell ────────────────────────────────────────────── */
.pf-act-cell { display: flex; align-items: center; gap: 5px; }
.pf-act-btn { font-size: 11px; padding: 3px 9px; border: 1px solid var(--border); background: none; color: var(--text2); border-radius: 4px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.pf-act-btn:hover { border-color: var(--accent); color: var(--accent); }
.pf-act-add { color: var(--accent); border-color: var(--accent-border); }
.pf-act-del { color: var(--red); border-color: var(--red-border); }
.pf-act-del:hover { border-color: var(--red); }

/* ── Table footer ────────────────────────────────────────────── */
.pf-tbl-footer { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface2); font-size: 12px; color: var(--text2); flex-wrap: wrap; gap: 8px; }
.pf-tbl-footer strong { color: var(--text); }

/* ── Factor mini badges (Scores view) ───────────────────────── */
.pf-factors-mini { display: flex; gap: 4px; flex-wrap: wrap; }
.pf-fmini { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 32px; }
.pf-fmini-key { font-size: 8px; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.pf-fmini-val { font-size: 11px; font-weight: 700; }

/* ── Buttons ─────────────────────────────────────────────────── */
.pf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: opacity .15s; white-space: nowrap; font-family: var(--body); }
.pf-btn:hover { opacity: .82; }
.pf-btn:disabled { opacity: .4; cursor: default; }
.pf-btn-primary { background: var(--accent); color: #fff; }
.pf-btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.pf-btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Empty / loading ─────────────────────────────────────────── */
.pf-empty { text-align: center; padding: 60px 24px; color: var(--text2); }
.pf-empty-icon { font-size: 44px; margin-bottom: 14px; }
.pf-empty h2 { font-size: 19px; color: var(--text); margin-bottom: 8px; }
.pf-empty p { font-size: 13px; margin-bottom: 22px; }
.pf-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--text2); font-size: 13px; }
.pf-spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: pf-spin .7s linear infinite; }
@keyframes pf-spin { to { transform: rotate(360deg); } }
.pf-error-bar { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--red-dim); border: 1px solid var(--red-border); border-radius: 8px; font-size: 13px; color: var(--text); }

/* ── Risk Engine card ────────────────────────────────────────── */
.pf-risk-engine { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; grid-column: 1 / -1; }
.pf-risk-tabs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pf-risk-tab-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pf-risk-tab { font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 5px; cursor: pointer; border: 1px solid var(--border); background: none; color: var(--text2); letter-spacing: .04em; text-transform: uppercase; transition: all .15s; }
.pf-risk-tab.active { background: var(--surface3); border-color: var(--accent); color: var(--accent); }
.pf-risk-tab:hover:not(.active) { color: var(--text); border-color: var(--border2); }
.pf-risk-tab-group {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text3); white-space: nowrap; min-width: 78px;
}
.pf-risk-explainer {
  font-size: 12px; color: var(--text2); line-height: 1.5;
  margin-bottom: 14px; padding: 9px 14px;
  background: var(--surface2); border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0;
}
.pf-risk-panels > div { display: none; }
.pf-risk-panels > div.active { display: block; }

/* Concentration panel */
.pf-conc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
@media(max-width:700px){ .pf-conc-grid { grid-template-columns: repeat(2,1fr); } }
.pf-conc-metric { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.pf-conc-label { font-size: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.pf-conc-val { font-size: 18px; font-weight: 800; color: var(--text); }
.pf-conc-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
.pf-hhi-bar-wrap { margin-top: 10px; }
.pf-hhi-bar-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) 0%, var(--accent) 10%, var(--amber) 10%, var(--amber) 25%, var(--red) 25%, var(--red) 100%); position: relative; margin: 6px 0 4px; }
.pf-hhi-needle { position: absolute; top: -4px; width: 2px; height: 14px; background: var(--text); border-radius: 1px; transform: translateX(-50%); transition: left .6s ease; }
.pf-hhi-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--text2); }

/* VaR panel */
.pf-var-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 12px; }
@media(max-width:600px){ .pf-var-grid { grid-template-columns: 1fr; } }
.pf-var-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.pf-var-conf { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.pf-metric-tip { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--border); color: var(--text2); font-size: 8px; font-weight: 700; cursor: pointer; position: relative; flex-shrink: 0; font-style: normal; letter-spacing: 0; text-transform: none; -webkit-tap-highlight-color: transparent; }
.pf-metric-tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 11px; font-size: 11px; line-height: 1.6; color: var(--text); white-space: pre-wrap; width: 230px; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 999; font-weight: 400; box-shadow: 0 4px 20px rgba(0,0,0,.4); }
@media (hover: hover) { .pf-metric-tip:hover::after { opacity: 1; } }
.pf-metric-tip.open::after { opacity: 1; }
.pf-actual-pl-banner { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.pf-var-main { font-size: 22px; font-weight: 800; }
.pf-var-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
.pf-var-cvar { font-size: 12px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.pf-var-note { font-size: 11px; color: var(--text2); line-height: 1.5; padding: 8px 0; }
.pf-var-loading { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); padding: 16px 0; }

/* Stress test panel */
.pf-stress-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
@media(max-width:700px){ .pf-stress-grid { grid-template-columns: 1fr; } }
.pf-stress-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.pf-stress-card:hover { border-color: var(--border2); }
.pf-stress-card.active { border-color: var(--accent); background: var(--accent-dim); }
.pf-stress-label { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.pf-stress-desc { font-size: 10px; color: var(--text2); margin-bottom: 8px; }
.pf-stress-pct { font-size: 20px; font-weight: 800; color: var(--red); }
.pf-stress-dollar { font-size: 11px; color: var(--text2); }
.pf-stress-detail { margin-top: 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: none; }
.pf-stress-detail.show { display: block; }
.pf-stress-detail-title { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.pf-stress-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.pf-stress-row:last-child { border-bottom: none; }
.pf-stress-row-ticker { font-weight: 700; width: 52px; flex-shrink: 0; }
.pf-stress-row-shock { color: var(--red); width: 48px; text-align: right; flex-shrink: 0; font-weight: 600; }
.pf-stress-row-impact { color: var(--red); text-align: right; flex: 1; }

/* Diversification panel */
.pf-dr-score-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.pf-dr-circle { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface2); }
.pf-dr-circle-num { font-size: 18px; font-weight: 800; }
.pf-corr-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.pf-corr-row:last-child { border-bottom: none; }
.pf-corr-pair { font-weight: 700; flex: 1; }
.pf-corr-val { width: 38px; text-align: right; font-weight: 600; }
.pf-corr-bar-bg { width: 60px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pf-corr-bar { height: 4px; border-radius: 2px; }

/* Beta row in metrics */
.pf-beta-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 4px; }

/* ── Allocation panel ─────────────────────────────────────────── */
.pf-alloc-class-row { display:flex; align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid var(--border); }
.pf-alloc-class-row:last-child { border-bottom:none; }
.pf-alloc-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.pf-alloc-label { font-size:12px; color:var(--text2); width:80px; flex-shrink:0; }
.pf-alloc-bar-bg { flex:1; height:6px; background:var(--border); border-radius:3px; overflow:hidden; position:relative; min-width:80px; }
.pf-alloc-actual-pct { font-size:13px; font-weight:700; width:44px; text-align:right; flex-shrink:0; }
.pf-alloc-input { width:46px; padding:3px 5px; background:var(--surface2); border:1px solid var(--border); border-radius:4px; color:var(--text); font-size:12px; text-align:right; font-family:var(--body); }
.pf-alloc-input:focus { border-color:var(--accent); outline:none; }
.pf-alloc-dev { font-size:11px; font-weight:700; width:46px; text-align:right; flex-shrink:0; }
.pf-alloc-save-row { display:flex; align-items:center; justify-content:space-between; margin-top:12px; flex-wrap:wrap; gap:8px; }
.pf-benchmark-row { display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.pf-benchmark-sel { flex:1; min-width:160px; padding:6px 10px; background:var(--surface2); border:1px solid var(--border); border-radius:6px; color:var(--text); font-size:13px; font-family:var(--body); cursor:pointer; }

/* ── Modal ───────────────────────────────────────────────────── */
.pf-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.pf-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.pf-modal-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.pf-modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.pf-modal-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 17px; padding: 3px; }
.pf-modal-close:hover { color: var(--text); }
.pf-field { margin-bottom: 14px; }
.pf-field label { display: block; font-size: 11px; font-weight: 600; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.pf-field input { width: 100%; padding: 9px 11px; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-size: 14px; font-family: var(--body); outline: none; box-sizing: border-box; }
.pf-field input:focus { border-color: var(--accent); }
.pf-field input:disabled { opacity: .5; }
.pf-field-hint { font-size: 11px; color: var(--text2); margin-top: 4px; }
.pf-modal-type { display: flex; gap: 8px; margin-bottom: 16px; }
.pf-type-btn { flex: 1; padding: 7px; border: 1px solid var(--border); border-radius: 6px; background: none; color: var(--text2); font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--body); }
.pf-type-btn.active-buy { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.pf-type-btn.active-sell { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.pf-modal-err { font-size: 12px; color: var(--red); margin-bottom: 10px; min-height: 16px; }
.pf-modal-actions { display: flex; gap: 8px; }
.pf-modal-actions .pf-btn { flex: 1; }
