/* Portfolio page (app/js/views/positions.js), Photon-style layout in Ripper's own look. Scoped under .hd. */
.hd { display: grid; gap: 16px; }
.hd-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }

/* summary card */
.hd-sum-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hd-sum-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hd-sum-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd .hd-wlab { margin: 0; display: inline-flex; }
.hd select.hd-wsel {
  width: auto; max-width: 240px; height: 34px; padding: 0 30px 0 12px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600;
  background-color: var(--raise); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.hd-range button { height: 28px; padding: 0 10px; font-size: 12.5px; }
.hd-bal { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }
.hd-bal-nat { font-size: 26px; font-weight: 700; letter-spacing: -.4px; line-height: 1.2; }
.hd-bal-usd { font-size: 15px; font-weight: 500; }
.hd-stats { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.hd-stat { display: grid; gap: 3px; min-width: 0; align-content: start; }
.hd-k { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-stat strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-pct { font-size: 12px; font-weight: 600; }
.hd .up { color: var(--up); } .hd .down { color: var(--down); }
@media (max-width: 1100px) { .hd-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .hd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hd-card { padding: 14px; } .hd-bal-nat { font-size: 22px; } }

/* subtabs: underlined active tab */
.hd-main { padding-top: 6px; }
.hd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -20px 14px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.hd-tabs button {
  display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.hd-tabs button:hover { color: var(--text); }
.hd-tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.hd-tabs button.on .ic { color: var(--accent); }
@media (max-width: 560px) { .hd-tabs { margin: 0 -14px 12px; padding: 0 6px; } }

/* holdings toolbar */
.hd-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hd-tools-l, .hd-tools-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.hd input.hd-in, .hd select.hd-in {
  width: auto; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel);
  color: var(--text); font: inherit; font-size: 13px; margin: 0;
}
.hd-fic, .hd-search { display: inline-flex; align-items: center; gap: 0; position: relative; }
.hd-fic .ic, .hd-search .ic { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.hd .hd-fic select.hd-in { padding-left: 30px; padding-right: 26px; cursor: pointer; }
.hd .hd-search input.hd-in { padding-left: 30px; width: 170px; }
.hd .hd-addr { width: 260px; max-width: 100%; }
.hd-tools-r .btn.small { height: 34px; gap: 6px; display: inline-flex; align-items: center; }
.hd label.hd-tg { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; }
.hd-tg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hd-sw { width: 30px; height: 18px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background .15s; }
.hd-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.hd-tg input:checked + .hd-sw { background: var(--accent); }
.hd-tg input:checked + .hd-sw::after { transform: translateX(12px); }
.hd-tg input:focus-visible + .hd-sw { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 700px) { .hd-tools-r { width: 100%; } .hd .hd-addr { flex: 1; width: auto; min-width: 0; } .hd .hd-search input.hd-in { width: 130px; } }

/* holdings rows (the .ps-row grid comes from launch.css) */
.hd-list, .hd .ps-list { display: grid; gap: 8px; }
.hd-list:not(:empty) { margin-bottom: 8px; }
.hd-subh { font-size: 11.5px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.hd-item { border-radius: 10px; }
.hd-item.is-hidden { opacity: .6; }
.hd-item.exp { box-shadow: 0 0 0 1px var(--line-strong); }
.hd-tokc { display: flex; align-items: center; gap: 4px; min-width: 0; }
.hd-caret { width: 20px; height: 20px; flex: none; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; border-radius: 5px; }
button.hd-caret:hover { background: var(--raise); color: var(--text); }
.hd-detail { padding: 4px 12px 10px 36px; overflow-x: auto; }
.hd-mini { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.hd-mini td { padding: 4px 10px 4px 0; white-space: nowrap; border-top: 1px solid var(--line); }
.hd-none { margin: 4px 0; }
.hd-act td { white-space: nowrap; }
.hd .ps-cal .cal-head { margin-top: 2px; }
@media (max-width: 1000px) { .hd-tokc { grid-column: 1 / -1; } }
