/* The fake trading platform's look: dark, dense and familiar, like the real ones. Everything prefixed tp-.
   Scam Literacy's own parts (the strip, the explanation screens) are styled in /demo/shared/shell.css. */
.tp-body {
  --tp-bg: #0B0F14; --tp-panel: #111821; --tp-raised: #1A2430; --tp-line: #222E3C; --tp-grid: #18212B;
  --tp-text: #E6EDF3; --tp-muted: #8B98A8; --tp-up: #1FC48A; --tp-down: #F0506E;
  --tp-accent: #4F8CFF; --tp-gold: #F5B942;
  --tp-watermark: rgba(230, 237, 243, .07); --tp-cross: rgba(230, 237, 243, .45);
  --tp-font: Inter, 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--tp-bg); color: var(--tp-text);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
/* Japan: a rising price is red and a falling one blue. So are Buy and Sell. */
html[data-rise="red"] .tp-body { --tp-up: #F0506E; --tp-down: #3D8BFF; }
:lang(ja) .tp-body { --tp-font: Inter, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', Meiryo, system-ui, sans-serif; }

.tp-noscript { margin: 0; padding: 1rem; background: #FFC83D; color: #10303B; font: 700 1rem/1.5 system-ui, sans-serif; }
.tp { flex: 1; min-height: 0; display: flex; flex-direction: column; font: .8125rem/1.4 var(--tp-font); font-variant-numeric: tabular-nums; color-scheme: dark; scrollbar-color: #2B3A4B transparent; }
.tp h2, .tp p, .tp ul, .tp ol, .tp dl, .tp dd { margin: 0; padding: 0; }
.tp ul, .tp ol { list-style: none; }
.tp button, .tp-dlg button { font: inherit; color: inherit; cursor: pointer; }
.tp button:disabled { cursor: not-allowed; }
.tp :focus-visible, .tp-dlg :focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 2px; border-radius: 4px; }
.tp-up { color: var(--tp-up); }
.tp-down { color: var(--tp-down); }
.tp-h { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--tp-muted); margin-bottom: .6rem !important; }
.tp-label { font-size: .75rem; color: var(--tp-muted); margin: 0 0 .35rem !important; }
.tp-empty { color: var(--tp-muted); }

/* ---------- Top bar ---------- */
/* Phone: the name and the balance on one line, Deposit and Withdraw side by side under them. */
.tp-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: .5rem; padding: .5rem .9rem; background: var(--tp-panel); border-bottom: 1px solid var(--tp-line); }
.tp-acct { display: contents; }
.tp-stat { justify-self: end; text-align: right; }
.tp-brand { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.tp-logo { flex: none; width: 1.75rem; height: 1.75rem; }
.tp-brand-name { font-size: 1.0625rem; font-weight: 800; letter-spacing: .14em; }
.tp-brand-tag { font-size: .625rem; font-weight: 700; padding: .1rem .35rem; border-radius: 4px; background: rgba(79, 140, 255, .16); color: var(--tp-accent); }
.tp-nav { display: none; gap: 1.4rem; color: var(--tp-muted); font-weight: 600; }
.tp-nav .is-on { color: var(--tp-text); box-shadow: 0 1.05rem 0 -0.9rem var(--tp-accent); }
.tp-stat { display: flex; flex-direction: column; line-height: 1.2; padding: .15rem .5rem; border-radius: 8px; }
.tp-k { font-size: .6875rem; color: var(--tp-muted); }
.tp-v { font-size: 1.0625rem; font-weight: 700; }
.tp-stat-today { display: none; }
.tp-btn {
  min-height: 2.25rem; padding: .35rem .9rem; border-radius: 8px; border: 1px solid var(--tp-line);
  background: var(--tp-raised); font-weight: 600; white-space: nowrap;
}
.tp-btn:hover:not(:disabled) { border-color: var(--tp-muted); }
.tp-btn-accent { background: var(--tp-accent); border-color: var(--tp-accent); color: #fff !important; }
.tp-btn-accent:hover:not(:disabled) { filter: brightness(1.1); }
.tp-btn-block { width: 100%; min-height: 2.75rem; white-space: normal; }
.tp-btn:disabled { opacity: .55; }

/* ---------- "Latest withdrawals" ---------- */
.tp-ticker { display: flex; align-items: center; gap: .9rem; padding: .3rem .9rem; background: var(--tp-bg); border-bottom: 1px solid var(--tp-line); font-size: .75rem; color: var(--tp-muted); }
.tp-ticker-title { flex: none; color: var(--tp-gold); font-weight: 600; }
.tp-ticker-run { display: flex; overflow: hidden; min-width: 0; }
.tp-ticker-list { flex: none; display: flex; gap: 2.25rem; padding-right: 2.25rem !important; white-space: nowrap; }
.tp-ticker-list li::before { content: '● '; color: #1FC48A; font-size: .6em; vertical-align: middle; }

/* ---------- Layout: phone first, one column ---------- */
.tp-main {
  flex: 1; min-height: 0; display: grid; gap: 1px; background: var(--tp-line);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "markets" "head" "chart" "ticket" "pos" "chat" "hist";
}
.tp-main > * { background: var(--tp-panel); min-width: 0; }
.tp-markets { grid-area: markets; padding: .5rem .6rem; }
.tp-chart-head { grid-area: head; }
.tp-chart { grid-area: chart; }
.tp-ticket { grid-area: ticket; padding: .9rem; }
.tp-pos { grid-area: pos; padding: .9rem; }
.tp-chat { grid-area: chat; }
.tp-hist { grid-area: hist; padding: .9rem; }

/* ---------- Markets ---------- */
.tp-markets .tp-h { display: none; }
.tp-markets ul { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
.tp-mkt {
  display: grid; grid-template-columns: auto auto; gap: 0 .7rem; align-items: baseline; text-align: left;
  min-height: 2.75rem; padding: .35rem .65rem; border-radius: 8px; border: 1px solid var(--tp-line); background: transparent; white-space: nowrap;
}
.tp-mkt:hover { background: var(--tp-raised); }
.tp-mkt[aria-pressed="true"] { background: var(--tp-raised); border-color: var(--tp-accent); }
.tp-mkt-sym { font-weight: 700; }
.tp-mkt-name { display: none; color: var(--tp-muted); font-size: .6875rem; }
.tp-mkt-price { grid-column: 1; font-weight: 600; }
.tp-mkt-chg { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: .75rem; font-weight: 600; }

/* ---------- Chart ---------- */
.tp-chart-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; padding: .55rem .9rem; }
.tp-sym { display: flex; align-items: baseline; gap: .5rem; }
.tp-sym strong { font-size: 1.0625rem; }
.tp-sym span { color: var(--tp-muted); font-size: .75rem; }
.tp-last { display: flex; align-items: baseline; gap: .5rem; }
.tp-last strong { font-size: 1.25rem; font-weight: 700; }
.tp-last span { font-weight: 600; }
/* "Live" and "online" are always green, also where a rising price is red. */
.tp-live { display: inline-flex; align-items: center; gap: .35rem; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #1FC48A; }
.tp-live i, .tp-chat-role i { width: .5rem; height: .5rem; border-radius: 50%; background: #1FC48A; }
.tp-tf { margin-left: auto; display: flex; gap: .25rem; }
.tp-chip {
  min-height: 2rem; padding: .2rem .7rem; border-radius: 6px; border: 1px solid var(--tp-line); background: transparent;
  font-weight: 600; white-space: nowrap; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
}
.tp-chip:hover:not(:disabled) { background: var(--tp-raised); }
.tp-chip[aria-pressed="true"] { background: var(--tp-raised); border-color: var(--tp-accent); color: var(--tp-accent) !important; }
.tp-chip:disabled { opacity: .55; }
.tp-chip small { font-size: .625rem; font-weight: 700; color: var(--tp-gold); }
.tp-chart { position: relative; height: 46vh; min-height: 16rem; }
.tp-chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: crosshair; }
.tp-legend { position: absolute; z-index: 1; top: .35rem; left: .7rem; right: 5rem; font-size: .6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tp-toast {
  position: absolute; z-index: 2; left: 50%; top: 2.2rem; transform: translateX(-50%); max-width: calc(100% - 2rem);
  padding: .6rem 1.1rem !important; border-radius: 10px; background: var(--tp-up); color: #04130D; font-size: 1rem; font-weight: 800; text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
}
html[data-rise="red"] .tp-toast { color: #fff; }

/* ---------- Ticket ---------- */
.tp-chips { display: flex; gap: .4rem; }
.tp-chips .tp-chip { flex: 1; min-height: 2.5rem; }
.tp-terms { display: grid; gap: .3rem; margin: .8rem 0 !important; }
.tp-terms div { display: flex; justify-content: space-between; gap: 1rem; }
.tp-terms dt { color: var(--tp-muted); }
.tp-terms dd { font-weight: 600; }
.tp-sides { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.tp-side {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; min-height: 4.5rem; padding: .55rem .4rem;
  border: 0; border-radius: 10px; color: #fff !important; line-height: 1.2;
}
.tp-side-buy { background: var(--tp-up); }
.tp-side-sell { background: var(--tp-down); }
.tp-side-name { font-size: 1.0625rem; font-weight: 800; }
.tp-side b { font-size: .875rem; font-weight: 600; }
.tp-side small { font-size: .6875rem; opacity: .9; }
.tp-side:hover:not(:disabled) { filter: brightness(1.1); }
.tp-side:disabled { opacity: .4; }
.tp-note { margin-top: .7rem !important; padding: .5rem .7rem !important; border-radius: 8px; background: rgba(245, 185, 66, .12); color: var(--tp-gold); font-weight: 600; }

/* ---------- Open trade ---------- */
.tp-pos-top { display: flex; align-items: center; gap: .5rem; }
.tp-pos-top span:last-child { margin-left: auto; color: var(--tp-muted); }
.tp-badge { display: inline-block; padding: .1rem .45rem; border-radius: 4px; font-size: .6875rem; font-weight: 700; color: #fff; }
.tp-badge-buy { background: var(--tp-up); }
.tp-badge-sell { background: var(--tp-down); }
.tp-pos-pl { font-size: 1.75rem; font-weight: 800; line-height: 1.2; margin: .3rem 0 0 !important; }
.tp-pos .tp-terms { margin: .4rem 0 .6rem !important; }
.tp-progress { height: .3rem; border-radius: 999px; background: var(--tp-raised); overflow: hidden; }
.tp-progress i { display: block; height: 100%; width: 0; background: var(--tp-accent); }
.tp-pos-time { margin-top: .35rem !important; font-size: .75rem; color: var(--tp-muted); }
.tp-link { background: none; border: 0; padding: .4rem 0; min-height: 2.25rem; color: var(--tp-muted) !important; text-decoration: underline; text-underline-offset: .2em; }
.tp-link:hover { color: var(--tp-text) !important; }

/* ---------- History ---------- */
.tp-hist li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-top: 1px solid var(--tp-line); }
.tp-hist li:first-child { border-top: 0; }
.tp-hist-amount { color: var(--tp-muted); }
.tp-hist li strong { margin-left: auto; }

/* ---------- The "account manager" ---------- */
.tp-chat { display: flex; flex-direction: column; min-height: 12rem; }
.tp-chat-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--tp-line); }
.tp-avatar { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #4F8CFF, #7B5CFF); color: #fff; font-weight: 800; font-size: 1rem; }
.tp-chat-name { font-size: .875rem; font-weight: 700; }
.tp-chat-role { display: flex; align-items: center; gap: .35rem; font-size: .6875rem; color: var(--tp-muted); }
.tp-chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: .8rem .9rem !important; display: flex; flex-direction: column; gap: .55rem; max-height: 16rem; }
.tp-chat-log li { align-self: flex-start; max-width: 92%; padding: .5rem .7rem; border-radius: 12px 12px 12px 3px; background: var(--tp-raised); font-size: .875rem; line-height: 1.4; }
.tp-chat-log time { display: block; margin-top: .15rem; font-size: .625rem; color: var(--tp-muted); }
.tp-typing { display: flex; gap: .25rem; padding: 0 .9rem .8rem !important; }
.tp-typing i { width: .4rem; height: .4rem; border-radius: 50%; background: var(--tp-muted); }

.tp-foot { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; padding: .35rem .9rem; background: var(--tp-bg); border-top: 1px solid var(--tp-line); font-size: .6875rem; color: var(--tp-muted); }

/* ---------- Popups (below Scam Literacy's strip, which stays in reach) ---------- */
.tp-dlg {
  position: fixed; inset: var(--sl-bar-top, var(--sl-bar-h)) 0 0 0; z-index: 40; overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: .75rem; background: rgba(4, 7, 10, .74);
  font: .875rem/1.45 var(--tp-font); font-variant-numeric: tabular-nums; color: var(--tp-text); color-scheme: dark;
}
.tp-dlg-box { width: 100%; max-width: 27rem; padding: 1.25rem; border-radius: 14px; background: var(--tp-panel); border: 1px solid var(--tp-line); box-shadow: 0 24px 70px rgba(0, 0, 0, .6); overflow-wrap: anywhere; }
.tp-dlg-box > * { margin: 0 0 .7rem; }
.tp-dlg-box > :last-child { margin-bottom: 0; }
.tp-dlg h2 { font-size: 1.25rem; line-height: 1.2; font-weight: 800; }
.tp-dlg h2:focus { outline: none; }
.tp-dlg-badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: rgba(245, 185, 66, .16); color: var(--tp-gold); font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.tp-dlg-timer { padding: .5rem .7rem; border-radius: 8px; background: rgba(240, 80, 110, .14); color: #FF8EA3; font-weight: 700; text-align: center; }
.tp-chips-wide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 30rem) { .tp-chips-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tp-chips-wide .tp-chip { min-height: 2.9rem; }
.tp-dlg-get { color: var(--tp-up); font-weight: 700; }
.tp-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.tp-method {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; min-height: 4.75rem; padding: .6rem .3rem;
  border-radius: 10px; border: 1px solid var(--tp-line); background: var(--tp-raised); font-weight: 600; line-height: 1.2; text-align: center;
}
.tp-method:hover { border-color: var(--tp-accent); }
.tp-method svg { width: 1.75rem; height: 1.75rem; color: var(--tp-accent); }
.tp-dlg-secure { font-size: .75rem; color: var(--tp-muted); text-align: center; }
.tp-dlg .tp-link { display: block; margin-inline: auto; }
.tp-dlg-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.tp-dlg-row span { color: var(--tp-muted); }
.tp-dlg-row strong { font-size: 1.5rem; }
.tp-hold { padding: .8rem .9rem; border-radius: 10px; border: 1px solid rgba(245, 185, 66, .5); background: rgba(245, 185, 66, .1); }
.tp-hold strong { display: block; color: var(--tp-gold); margin-bottom: .25rem; }
.tp-hold p { margin: 0; }

/* The walkthrough needs room under the page for its panel, and space above each trick it scrolls to. */
.is-walk .tp { padding-bottom: 15rem; }

/* ---------- From tablet: chart beside the ticket ---------- */
@media (min-width: 44rem) {
  .tp-head { display: flex; gap: 1.5rem; }
  .tp-acct { margin-left: auto; display: flex; align-items: center; gap: .6rem 1.1rem; }
  .tp-stat { text-align: left; }
  .tp-brand { flex: none; }
  .tp-main {
    grid-template-columns: minmax(0, 1fr) 18rem;
    grid-template-areas: "markets markets" "head ticket" "chart ticket" "chart chat" "pos chat" "hist hist";
    grid-template-rows: auto auto auto minmax(12rem, 1fr) auto auto;
  }
  .tp-chart { height: auto; min-height: 24rem; }
  .tp-stat-today { display: flex; }
  .tp-chat-log { max-height: none; }
}

/* ---------- Desktop: the whole platform fits the window, like a trading terminal ---------- */
@media (min-width: 68rem) and (min-height: 40rem) {
  .tp-body { height: 100vh; height: 100dvh; overflow: hidden; }
  .is-walk .tp { padding-bottom: 0; }
  .tp-nav { display: flex; }
  .tp-main {
    grid-template-columns: 15rem minmax(0, 1fr) 19.5rem;
    grid-template-areas: "markets head ticket" "markets chart ticket" "markets chart chat" "hist pos chat";
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .tp-chart { min-height: 0; }
  .tp-markets { padding: .9rem .6rem; overflow-y: auto; }
  .tp-markets .tp-h { display: block; padding: 0 .3rem; }
  .tp-markets ul { flex-direction: column; gap: .15rem; overflow: visible; }
  .tp-mkt { width: 100%; grid-template-columns: 1fr auto; border-color: transparent; padding: .45rem .5rem; }
  .tp-mkt-name { display: block; grid-column: 1; grid-row: 2; }
  .tp-mkt-price { grid-column: 2; grid-row: 1; text-align: right; }
  .tp-mkt-chg { grid-column: 2; grid-row: 2; text-align: right; }
  .tp-pos { min-height: 10.5rem; }
  .tp-hist { max-height: 13rem; overflow-y: auto; }
  .tp-chat { min-height: 0; }
}

/* ---------- Motion: only for visitors who have not asked for less ---------- */
@media (prefers-reduced-motion: no-preference) {
  .tp-ticker-list { animation: tp-run 70s linear infinite; }
  .tp-live i { animation: tp-pulse 1.6s ease-in-out infinite; }
  .tp-typing i { animation: tp-bounce 1s ease-in-out infinite; }
  .tp-typing i:nth-child(2) { animation-delay: .15s; }
  .tp-typing i:nth-child(3) { animation-delay: .3s; }
  .tp-toast { animation: tp-pop .35s ease-out; }
  .tp-stat.is-bumped { animation: tp-bump 1.2s ease-out; }
  .tp-progress i { transition: width .25s linear; }
  .is-paused .tp-ticker-list, .is-paused .tp-live i, .is-paused .tp-typing i { animation-play-state: paused; }
}
@keyframes tp-run { to { transform: translateX(-100%); } }
@keyframes tp-pulse { 50% { opacity: .35; } }
@keyframes tp-bounce { 50% { transform: translateY(-.25rem); } }
@keyframes tp-pop { from { opacity: 0; transform: translateX(-50%) scale(.9); } }
@keyframes tp-bump { 0% { background: rgba(31, 196, 138, .35); } 100% { background: transparent; } }
