/* Profit page (classes pf-*: every page stylesheet loads on every page) */
.pf-label { color: var(--muted); font-size: 12.5px; }
.pf-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* hero: one big number, best trade beside it */
.pf-hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; padding: 24px 26px;
  background: radial-gradient(600px 220px at 0% 0%, rgba(62, 207, 142, .07), transparent 70%), var(--surface);
}
.pf-hero-main { min-width: 0; }
.pf-hero-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.pf-hero-value { font-size: 40px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pf-margin { font-size: 13px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.pf-margin.pos { background: rgba(62, 207, 142, .08); border-color: rgba(62, 207, 142, .22); }
.pf-margin.neg { background: rgba(240, 97, 109, .08); border-color: rgba(240, 97, 109, .22); }
.pf-best { display: flex; align-items: center; gap: 14px; min-width: 0; max-width: 440px; padding: 10px 16px 10px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); animation: rise .34s var(--ease) both; }
.pf-proj { min-width: 0; padding-left: 28px; border-left: 1px solid var(--border); margin-right: auto; }
.pf-proj-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pf-proj-value.muted { font-size: 15px; font-weight: 500; }
.pf-proj .pf-hero-row { margin-top: 4px; }
.pf-proj-cut b { color: var(--text); font-weight: 600; }
.pf-best-text { min-width: 0; }
.pf-best-name { font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.pf-best-num { font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* compact cards */
.pf-cards { margin-top: 14px; }
.pf-card { display: flex; flex-direction: column; }
.pf-value { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-unit { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.pf-bar { height: 6px; margin-top: 12px; border-radius: 6px; background: rgba(232, 176, 75, .16); overflow: hidden; }
.pf-bar-fill { display: block; height: 100%; border-radius: 6px; background: var(--pos); transform-origin: left; animation: bar-x .7s var(--ease) .15s both; }
.pf-split { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pf-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--pos); vertical-align: 1px; }
/* date range + "How it's charged" disclosure (native details; the rule opens in flow under the button) */
.pf-covers { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 14px 2px 0; color: var(--muted); font-size: 12.5px; line-height: 30px; }
.pf-how summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px; border-radius: 999px; list-style: none; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 500; transition: background .15s, border-color .15s;
}
.pf-how summary::-webkit-details-marker { display: none; }
.pf-how summary::before {
  content: "i"; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid currentColor; color: var(--accent); font: 600 10px/1 Georgia, serif;
}
.pf-how summary:hover, .pf-how[open] summary { background: var(--surface-3); border-color: #3a3f46; }
.pf-how summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-how ul {
  width: fit-content; max-width: 100%; margin: 8px 0 0; padding: 12px 18px 12px 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; line-height: 1.7; animation: rise .22s var(--ease) both;
}
.pf-how li::marker { color: var(--faint); }

/* toolbar: search + two chip groups */
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip {
  min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent;
  color: var(--muted); font: 500 12.5px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s; -webkit-tap-highlight-color: transparent;
}
.pf-chip:hover { color: var(--text); background: var(--surface-2); }
.pf-chip[aria-pressed="true"] { color: var(--text); background: var(--surface-3); border-color: #3a3f46; }
.pf-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* item thumb: fixed box, rarity glow + left edge */
.pf-thumb {
  --rarity: #5d626a;
  position: relative; flex: none; display: grid; place-items: center;
  width: var(--sz, 40px); height: var(--sz, 40px); border-radius: 9px; overflow: hidden;
  background: radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--rarity) 26%, transparent), transparent 72%), var(--surface-2);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--rarity) 70%, transparent);
}
.pf-thumb img { width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45)); animation: fade .3s ease-out both; }

/* trades table */
.pf-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pf-item-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.pf-phase { color: var(--accent); font-weight: 500; font-size: 11.5px; line-height: 1.4; }
.pf-sale { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pf-wait-chip { padding: 0 7px; font-size: 11px; line-height: 17px; }
.pf-would { color: var(--muted); font-weight: 400; }
.pf-would .roi-usd { font-weight: 400; }
.pf-would .roi-pct { color: var(--faint); opacity: 1; }
.pf-dt td { vertical-align: middle; }
@media (min-width: 721px) {
  .pf-dt td.item { white-space: normal; overflow: visible; min-width: 280px; padding-top: 9px; padding-bottom: 9px; }
}

@media (max-width: 720px) {
  .pf-hero { padding: 18px 16px; }
  .pf-hero-value { font-size: 32px; }
  .pf-best { max-width: none; width: 100%; }
  .pf-proj { padding-left: 0; border-left: 0; width: 100%; }
  .pf-value { font-size: 19px; }
  .pf-unit { display: none; }
  .pf-split { flex-direction: column; gap: 2px; }
  .pf-chip { min-height: 40px; }
  .pf-covers { grid-template-columns: minmax(0, 1fr); line-height: 1.5; }
  .pf-how summary { min-height: 36px; }
  /* compact rows (base.css .dt-x): the sale (and its 20% chip) under the name, Profit at the right edge; the rest on tap */
  .pf-dt .table-wrap td.pri:not(.item) { align-self: center; }
  .pf-dt .table-wrap tr[aria-expanded] > td:not(.pri) + td.pri { margin-left: 52px; } /* past the thumb */
  .pf-dt .table-wrap tr[aria-expanded] > td.pri:not(.item) + td.pri { margin-left: auto; }
  .pf-sale { flex-direction: row; align-items: center; gap: 8px; }
  .pf-would { align-items: flex-start; }
  .pf-dt .table-wrap td.item { font-weight: 400; }
  .pf-dt .pf-name { font-weight: 500; }
}
@media (max-width: 380px) {
  .pf-hero-value { font-size: 28px; }
}
