/* QMT portfolio: charcoal, warm ivory and amber; existing page tokens. */
.qpf-entry-actions { display:flex;align-items:center;gap:8px;margin-left:20px;padding-left:20px;border-left:1px solid var(--line); }
.qpf-entry-actions .secondary-btn { min-height:40px;padding:8px 16px;border-color:var(--line);background:var(--surface-2);color:var(--text);font-size:14px; }
.qpf-entry-actions .secondary-btn:first-child { color:var(--amber);border-color:#68551e;background:#221e11; }
.qpf-entry-actions .secondary-btn:hover { border-color:var(--amber); }
.qpf-holding-link { min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:6px;background:var(--surface-2);color:var(--text);font-weight:600; }
.qpf-holding-link:hover { border-color:var(--amber);color:var(--amber); }
dialog.qpf-dialog {
  --qpf-ivory:#e9e3d8;--qpf-ivory-text:#20211f;--qpf-soft:#999da1;
  width:min(1080px,calc(100vw - 48px));max-width:none;max-height:92dvh;
  padding:0;border:1px solid #414244;border-radius:14px;background:var(--surface);color:var(--text);box-shadow:0 24px 100px #0009;
}
dialog.qpf-dialog::backdrop { background:#0009;backdrop-filter:blur(1.5px); }
dialog.qpf-dialog[open] { display:flex;flex-direction:column; }
#qmtHoldingsDialog { width:min(1040px,calc(100vw - 48px)); }
#qmtHoldingsDialog[open] { height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);margin:20px 20px 20px auto; }
.qpf-dialog .dialog-head { display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:28px 32px 24px;border-bottom:1px solid var(--line-soft);background:var(--surface); }
.qpf-eyebrow { display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted);margin-bottom:10px;letter-spacing:.04em; }
.qpf-eyebrow i { width:3px;height:3px;border-radius:50%;background:var(--amber); }
.qpf-dialog h2 { margin:0 0 8px;font-size:28px;line-height:1.3;letter-spacing:-.025em;font-weight:650; }
.qpf-dialog .dialog-head p { margin:0;color:var(--muted);font-size:13px; }
.qpf-dialog .dialog-close { display:grid;place-items:center;flex-shrink:0;width:44px;height:44px;padding:0;border:0;border-radius:8px;background:var(--surface-2);color:var(--muted);font-size:28px;line-height:1; }
.qpf-dialog .dialog-close:hover { color:var(--text);background:#2d2e30; }
.qpf-head-actions { display:flex;align-items:center;gap:24px; }
.qpf-step { color:var(--amber);font-size:12px;white-space:nowrap; }
.qpf-body { min-height:0;padding:24px 32px;overflow:auto; }
#qmtHoldingsDialog .qpf-body { flex:1; }
.qpf-dialog svg { width:18px;height:18px;flex-shrink:0; }
.qpf-dialog input[type=checkbox] { appearance:none;display:inline-grid;place-content:center;width:18px;height:18px;flex:none;margin:0;border:1px solid #686a6d;border-radius:4px;background:transparent;cursor:pointer; }
.qpf-dialog input[type=checkbox]::after { content:"";width:8px;height:4px;transform:rotate(-45deg);border-left:2px solid #171300;border-bottom:2px solid #171300;opacity:0;margin-top:-2px; }
.qpf-dialog input[type=checkbox]:checked { background:var(--amber);border-color:var(--amber); }
.qpf-dialog input[type=checkbox]:checked::after { opacity:1; }
.qpf-dialog input[type=checkbox]:disabled { opacity:.4;cursor:default; }
.qpf-dialog .primary-btn { min-height:44px;border:0;border-radius:7px;gap:10px;padding:10px 20px;font-size:14px;font-weight:650; }
.qpf-dialog .primary-btn:disabled { opacity:1;background:#2b2d30;color:#999da1; }
.qpf-dialog button:focus-visible,.qpf-dialog input:focus-visible,.qpf-dialog select:focus-visible,.qpf-dialog summary:focus-visible { outline:2px solid var(--amber);outline-offset:3px; }
.qpf-metrics { display:grid;grid-template-columns:.85fr 1.2fr 1fr;gap:0;padding:24px 0;border-radius:9px;background:var(--qpf-ivory);color:var(--qpf-ivory-text); }
.qpf-metrics>div { padding:0 28px;min-width:0; }
.qpf-metrics>div+div { border-left:1px solid #c9c6be; }
.qpf-metrics span { display:block;margin-bottom:8px;color:#5b5c56;font-size:12px; }
.qpf-metrics strong { font-family:"Bahnschrift","Segoe UI","Noto Sans SC",sans-serif;font-size:32px;line-height:1.2;font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:-.03em; }
.qpf-metrics .qpf-up { color:#b8242e; }.qpf-metrics .qpf-down { color:#007638; }
.qpf-muted { color:var(--muted);font-size:12px;line-height:1.6; }
#qmtHoldingQuote { margin:12px 0 0;color:var(--qpf-soft); }
.qpf-list-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:32px 0 14px; }
.qpf-list-heading h3 { margin:0;font-size:16px;font-weight:600; }.qpf-list-heading>span { color:var(--qpf-soft);font-size:12px; }
.qpf-table-wrap { overflow:auto; }
.qpf-table { width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:14px; }
.qpf-table th { height:42px;color:var(--qpf-soft);font-size:12px;font-weight:400;background:var(--surface-2); }
.qpf-table th,.qpf-table td { text-align:right;padding:12px;border-bottom:1px solid var(--line-soft);white-space:nowrap; }
.qpf-table th:first-child,.qpf-table td:first-child { width:38%;text-align:left;padding-left:14px; }
.qpf-table th:last-child,.qpf-table td:last-child { padding-right:4px; }
.qpf-table td { height:92px; }
.qpf-table small { display:block;color:var(--qpf-soft);font-size:12px;line-height:1.5;margin-top:5px; }
.qpf-stock-name { display:flex;align-items:baseline;gap:10px; }.qpf-stock-name strong { font-size:16px;font-weight:600; }.qpf-stock-name>span { font-size:12px;color:var(--qpf-soft); }
.qpf-owner-name { max-width:270px;overflow:hidden;text-overflow:ellipsis; }
.qpf-number { font-weight:500;font-size:16px; }.qpf-unit { font-size:12px;color:var(--qpf-soft); }
.qpf-table details { max-width:300px;white-space:normal; }
.qpf-table summary { color:#d6b960;font-size:12px;cursor:pointer;line-height:28px; }
.qpf-table details p { margin:6px 0 0;padding:6px 0;font-size:12px;border-top:1px solid var(--line-soft); }.qpf-table details p span { display:block;color:var(--muted);margin-top:3px; }
.qpf-add,.qpf-added { display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;min-width:110px;padding:8px 10px;border:0;border-radius:6px;background:transparent;font-size:13px; }
.qpf-add { color:var(--amber);font-weight:500; }.qpf-add:hover { background:#ffc52c12; }.qpf-add:active { background:#ffc52c22; }
.qpf-added { color:#a2b0a8; }.qpf-added svg { width:16px;color:#58ad7f; }
.qpf-up { color:var(--red); }.qpf-down { color:var(--green); }
.qpf-empty { text-align:center!important;padding:48px 16px!important;color:var(--text);line-height:1.8; }.qpf-empty small { display:block;color:var(--muted); }
.qpf-footer { flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 32px;background:var(--surface-2);border-top:1px solid var(--line); }
.qpf-footer>div>span,.qpf-footer>span { color:var(--text);font-size:14px; }.qpf-footer p { margin:4px 0 0;font-size:12px;color:var(--qpf-soft); }
.qpf-status { margin:12px 0 0;color:#d5bc70;font-size:13px;line-height:1.6; }.qpf-status:empty { display:none; }.qpf-status.is-error { color:#ff9f9f; }
.qpf-query { display:grid;grid-template-columns:1fr 1.35fr auto;align-items:end;gap:20px; }
.qpf-query label { min-width:0; }.qpf-query label>span { display:block;color:var(--muted);font-size:12px;margin-bottom:8px; }.qpf-query label small { color:var(--qpf-soft);font-size:12px;margin-left:4px; }
.qpf-query input,.qpf-allocation select,.qpf-allocation input { width:100%;min-height:44px;padding:10px 12px;border:1px solid #414347;border-radius:6px;background:var(--bg);color:var(--text);font-size:14px;color-scheme:dark; }
.qpf-query input:hover,.qpf-allocation select:hover,.qpf-allocation input:hover { border-color:#6c7075; }
.qpf-query+p { margin:10px 0 20px;color:var(--qpf-soft); }
#qmtSyncRows { display:grid;gap:12px;margin-top:18px; }
.qpf-fill { display:grid;grid-template-columns:1fr 1.16fr;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);overflow:hidden; }
.qpf-fill.is-selected { border-color:#77602a; }.qpf-fill.is-selected .qpf-trade { box-shadow:inset 3px 0 0 var(--amber); }
.qpf-trade { padding:18px 20px; }.qpf-trade header { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.qpf-trade header label { display:flex;align-items:center;gap:10px;min-height:28px;cursor:pointer; }.qpf-trade header strong { font-size:15px;font-weight:600; }
.qpf-fill-stock { display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px;min-width:0; }.qpf-fill-stock strong { overflow-wrap:anywhere; }.qpf-fill-stock small { font-size:12px;color:var(--qpf-soft);white-space:nowrap; }
.qpf-side { font-size:12px;line-height:24px;padding:0 6px;border-radius:4px;background:#ff404810; }.qpf-side.qpf-down { background:#00ce7010; }
.qpf-tag { color:var(--qpf-soft);font-size:12px;white-space:nowrap; }
.qpf-fill-facts { display:flex;gap:44px;margin:14px 0 12px;padding-left:28px; }.qpf-fill-facts>div>span { display:block;font-size:12px;color:var(--qpf-soft);margin-bottom:4px; }.qpf-fill-facts strong { font-size:20px;line-height:1.2;font-family:"Bahnschrift","Segoe UI",sans-serif;font-weight:500; }.qpf-fill-facts small { margin-left:5px;color:var(--qpf-soft);font:12px "Microsoft YaHei",sans-serif; }
.qpf-deal-detail { margin-left:28px;font-size:12px;color:var(--qpf-soft); }.qpf-deal-detail summary { display:flex;justify-content:space-between;gap:12px;cursor:pointer;min-height:22px; }.qpf-deal-detail summary span { color:#b6b8bc; }.qpf-deal-detail summary span::after { content:"⌄";margin-left:6px; }.qpf-deal-detail p { margin:8px 0 0;line-height:1.8; }
.qpf-assignment { padding:20px;border-left:1px solid var(--line);display:flex;flex-direction:column;justify-content:center;min-width:0; }
.qpf-mini-label { display:flex;justify-content:space-between;margin-bottom:8px;color:var(--qpf-soft);font-size:12px; }.qpf-mini-label>span { width:128px; }
.qpf-allocation { display:grid;grid-template-columns:minmax(160px,1fr) 90px 28px;gap:8px;align-items:center; }.qpf-allocation+.qpf-allocation { margin-top:8px; }
.qpf-allocation select { font-size:12px;padding-left:10px; }.qpf-allocation label { display:flex;align-items:center;gap:6px;color:var(--qpf-soft);font-size:12px; }.qpf-allocation input { min-width:0;padding:10px 8px;font-variant-numeric:tabular-nums; }
.qpf-remove { width:28px;height:44px;padding:0;border:0;background:transparent;color:var(--muted);font-size:20px; }.qpf-remove:hover { color:var(--red); }.qpf-allocation:only-child .qpf-remove { visibility:hidden; }
.qpf-split { display:inline-flex;align-items:center;gap:5px;align-self:flex-start;min-height:36px;padding:6px 0 0;border:0;background:none;color:#d6b960;font-size:12px; }.qpf-split svg { width:14px;height:14px; }.qpf-split:hover { color:var(--amber); }
.qpf-managed { background:var(--surface); }.qpf-managed .qpf-tag { color:#7cae92; }.qpf-managed .qpf-assignment p { margin:4px 0; }
.qpf-sync-summary { min-width:0; }
.qpf-sync-summary #qmtConfirmHelp { color:#d5bc70;line-height:1.6; }
#qmtConfirmFills { flex-shrink:0; }
#qmtSyncPreview>.qpf-footer { position:sticky;bottom:-24px;margin:0 -32px -24px;padding-top:16px;padding-bottom:16px; }
@media(max-width:1150px) {
  .qpf-entry-actions { margin-left:12px;padding-left:12px; }
  .qpf-dialog .dialog-head { padding:24px; }.qpf-body { padding:20px 24px; }.qpf-footer { padding:18px 24px; }
  .qpf-table td,.qpf-table th { padding-left:8px;padding-right:8px; }.qpf-owner-name { max-width:210px; }
  .qpf-trade,.qpf-assignment { padding:16px; }.qpf-fill-facts { gap:28px; }.qpf-mini-label>span { width:122px; }
  #qmtSyncPreview>.qpf-footer { margin:0 -24px -20px;bottom:-20px; }
}
@media(max-width:767px) {
  dialog.qpf-dialog { width:calc(100vw - 24px); }.qpf-fill { grid-template-columns:1fr; }.qpf-assignment { border-left:0;border-top:1px solid var(--line); }
  .qpf-query { grid-template-columns:1fr; }.qpf-head-actions .qpf-step { display:none; }.qpf-list-heading>span { display:none; }.qpf-metrics>div { padding:0 14px; }.qpf-metrics strong { font-size:24px; }
  #qmtSyncPreview>.qpf-footer { align-items:stretch;flex-direction:column;gap:12px; }
}
@media(prefers-reduced-motion:no-preference) {
  .qpf-dialog button { transition:background-color .16s,color .16s,border-color .16s; }
  .qpf-dialog[open] { animation:qpf-enter .18s ease-out; }@keyframes qpf-enter { from { opacity:0;transform:translateY(6px); } to { opacity:1;transform:translateY(0); } }
}
