/* The account pages (Portfolio, History, Settings, Feedback, public profile): the shared page frame, panels, tables,
   fields and buttons, in the Trade page's language. --ob-* tokens only (theme.css, linked first). Each page adds its
   own file for what only it has. Black ground, white ink, one page title, 20px section titles, 14-15px body,
   13px grey captions. Cards are #0d0d0f with a hairline edge and 20px corners. Buttons are filled pills (white for
   the primary action, #151518 for the rest), never outlined. P&L is green/red; links are never underlined; nothing
   animates. */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ob-ground); color: var(--ob-ink); }
body { font-family: var(--ob-sans); font-size: 14px; line-height: 1.45; overflow-x: hidden; }
a { color: var(--ob-ink-2); text-decoration: none; }
@media (hover: hover) { a:hover { color: var(--ob-ink); text-decoration: none; } }
[hidden] { display: none !important; }
.num { font-variant-numeric: lining-nums tabular-nums; }
.up { color: var(--ob-up); }
.down { color: var(--ob-down); }
.dim { color: var(--ob-label); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page and head ---------- */
/* one container rule on every page (Markets, Leaderboard, Oracle, the account pages): the full width, 24px gutters,
   so the title and the left edge never jump between tabs */
.apage { max-width: none; margin: 0; padding: 0 24px 72px; display: flex; flex-direction: column; gap: 12px; }
.ahead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 36px 0 16px; }
.ahead h1 { font-size: var(--ob-h1, 28px); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
.ahead .lede { margin: 6px 0 0; color: var(--ob-label); font-size: 15px; }
.ahead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.apanel { background: var(--ob-surface); border: 1px solid var(--ob-surface-line); border-radius: 20px; padding: 20px 24px; min-width: 0; }
.apanel > h2 { margin: 0 0 14px; font-size: var(--ob-t-title); font-weight: 600; line-height: 1.25; color: var(--ob-ink); letter-spacing: -0.005em; }
.apanel > h2 .cnt { color: var(--ob-label); font-size: 15px; font-weight: 400; margin-left: 8px; letter-spacing: 0; }
.agrid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.agrid2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .lbl { font-size: var(--ob-t-small); color: var(--ob-label); }
.tile .v { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.tile .sub { font-size: var(--ob-t-small); color: var(--ob-label); }

/* ---------- tables: 14px rows, 13px grey heads, hairlines, numbers right-aligned ---------- */
.atable { width: 100%; border-collapse: collapse; font-size: 14px; }
.atable th { text-align: left; font-weight: 400; font-size: var(--ob-t-small); color: var(--ob-label); padding: 0 12px 10px; border-bottom: 1px solid var(--ob-line); white-space: nowrap; }
.atable td { padding: 0 12px; height: 52px; border-bottom: 1px solid var(--ob-line-lo); vertical-align: middle; color: var(--ob-ink); }
.atable tr:last-child td { border-bottom: 0; }
.atable .r { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.atable th:first-child, .atable td:first-child { padding-left: 0; }
.atable th:last-child, .atable td:last-child { padding-right: 0; }
.atable .t { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atable td.dim { color: var(--ob-label); }
/* P&L in a table cell keeps its green or red over the row's ink (".atable td" outranked ".up"/".down": "−$1.19 if
   sold" showed white) */
.atable td.up, .atable td .up { color: var(--ob-up); }
.atable td.down, .atable td .down { color: var(--ob-down); }
.tscroll { overflow-x: auto; }
.empty { color: var(--ob-label); font-size: 14px; margin: 4px 0; }

/* ---------- buttons: filled pills only ---------- */
.abtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border: 0; border-radius: var(--ob-pill); background: var(--ob-muted); color: var(--ob-ink); font: 600 14px/1 var(--ob-sans); cursor: pointer; white-space: nowrap; text-decoration: none; }
@media (hover: hover) { .abtn:hover:not(:disabled) { background: var(--ob-raise); color: var(--ob-ink); } }
.abtn.pri { background: var(--ob-brand); color: var(--ob-on-brand); }
@media (hover: hover) { .abtn.pri:hover:not(:disabled) { background: var(--ob-brand-2); color: var(--ob-on-brand); } }
/* destructive: the secondary pill with its word in red, so it never reads as a primary action */
.abtn.danger { background: var(--ob-muted); color: var(--ob-down); }
@media (hover: hover) { .abtn.danger:hover:not(:disabled) { background: var(--ob-raise); color: var(--ob-down); } }
/* the quieter action beside a primary one: still a filled pill, grey word */
.abtn.ghost { background: var(--ob-muted); color: var(--ob-ink-2); }
@media (hover: hover) { .abtn.ghost:hover:not(:disabled) { background: var(--ob-raise); color: var(--ob-ink); } }
.abtn:disabled { opacity: 0.45; cursor: default; }

/* ---------- fields: #151518 fill, 12px corners, no border, white focus ring ---------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .field > .flab { font-size: var(--ob-t-small); color: var(--ob-label); }
.ain { height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--ob-track); color: var(--ob-ink); font: 400 15px/1 var(--ob-sans); font-variant-numeric: lining-nums tabular-nums; min-width: 0; color-scheme: dark; }
.ain::placeholder { color: var(--ob-mute); }
.ain:focus { outline: none; }
.ain:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ob-focus); }
select.ain { padding-right: 36px; appearance: none; -webkit-appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23a1a1aa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
textarea.ain { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.amsg { min-height: 18px; font-size: var(--ob-t-small); color: var(--ob-label); margin: 0; }
.amsg.ok { color: var(--ob-ink-2); }
.amsg.bad { color: var(--ob-down-soft); }

@media (max-width: 900px) { .agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .agrid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .apage { padding: 0 16px 48px; gap: 10px; }
  .ahead { padding: 24px 0 8px; gap: 12px; }
  .ahead h1 { font-size: 26px; }
  .ahead .lede { font-size: 14px; }
  .ahead .acts { margin-left: 0; }
  .apanel { padding: 16px; border-radius: 16px; }
  .apanel > h2 { font-size: 18px; margin-bottom: 10px; }
  .tile .v { font-size: 20px; }
  .atable td { height: 52px; }
  .abtn { height: 44px; }
}

/* Keep this account / Sign in (Settings > Account; Portfolio and History when logged out, account-data.js): the sign-in
   page's block, a title, one line and its two buttons */
.stkeep { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin-bottom: 8px; }
.stkeep-t { margin: 0; font: 600 17px/1.25 var(--ob-sans); color: var(--ob-ink); }
.stkeep-x { margin: 0; font: 400 14px/1.5 var(--ob-sans); color: var(--ob-label); }
.stkeep-acts { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.stkeep-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 40px; padding: 0 16px; box-sizing: border-box; border: 0; border-radius: var(--ob-r); font: 510 14px/1 var(--ob-sans); text-decoration: none; cursor: pointer; }
.stkeep-btn.pri { background: var(--ob-ink); color: #000; }
@media (hover: hover) { .stkeep-btn.pri:hover:not(:disabled) { background: var(--ob-brand-2); color: #000; text-decoration: none; } }
.stkeep-btn.sec { background: rgba(255, 255, 255, 0.08); color: var(--ob-ink); }
@media (hover: hover) { .stkeep-btn.sec:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: var(--ob-ink); text-decoration: none; } }
.stkeep-btn:disabled { opacity: 0.6; cursor: default; }
.stkeep-btn:focus-visible { outline: 2px solid var(--ob-focus); outline-offset: 2px; }
.stkeep-btn .stsi-ico { color: inherit; }
@media (max-width: 640px) { .stkeep { max-width: none; } .stkeep-btn { height: 44px; } }
.apanel.aout { padding-bottom: 28px; }
@media (pointer: coarse) { .abtn { min-height: 44px; } }
