/*
 * Download platforms · Inbox · Giveaway terms (loads after pages.css).
 * Built from the shared parts: .card, .sec, .btn, .tag, .seg, .fund__ic, .ovl.
 * Tokens only. One radius (--d-r-sm for tiles and controls, --d-r for cards).
 */

/* Live badge + phone bell dot can hide at 0 unread */
.acg-nv__badge[hidden], .tb__dot[hidden] { display: none; }

/* ── Extra icon masks on the shared .fund__ic tile ── */
.fund__ic--win { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5.4 10.4 4.3v7.2H3zM11.6 4.1 21 2.8v8.7h-9.4zM3 12.6h7.4v7.2L3 18.6zM11.6 12.6H21v8.6l-9.4-1.3z'/%3E%3C/svg%3E"); }
.fund__ic--apple { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.5 12.7c0-2.4 2-3.6 2.1-3.7-1.1-1.7-2.9-1.9-3.5-1.9-1.5-.2-2.9.9-3.7.9-.8 0-1.9-.9-3.2-.8-1.6 0-3.2 1-4 2.4-1.7 3-.4 7.4 1.2 9.8.8 1.2 1.8 2.5 3 2.4 1.2 0 1.7-.8 3.1-.8 1.5 0 1.9.8 3.2.8 1.3 0 2.2-1.2 3-2.4.9-1.4 1.3-2.7 1.3-2.8 0 0-2.5-1-2.5-3.9zM14.1 5.5c.7-.8 1.1-1.9 1-3-1 0-2.1.6-2.8 1.4-.6.7-1.2 1.8-1 2.9 1.1.1 2.1-.5 2.8-1.3z'/%3E%3C/svg%3E"); }
.fund__ic--android { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M3.5 18a8.5 8.5 0 0 1 17 0zM7.6 14.2a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0-2.2 0zM14.2 14.2a1.1 1.1 0 1 0 2.2 0a1.1 1.1 0 1 0-2.2 0z'/%3E%3Cpath d='M7.2 9.6 5.4 6.6M16.8 9.6l1.8-3' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.fund__ic--web { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.4 2.5 3.5 5.5 3.5 9s-1.1 6.5-3.5 9c-2.4-2.5-3.5-5.5-3.5-9S9.6 5.5 12 3z'/%3E%3C/g%3E%3C/svg%3E"); }
.fund__ic--req { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h10v10H7zM10 3v4M14 3v4M10 17v4M14 17v4M3 10h4M3 14h4M17 10h4M17 14h4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.fund__ic--guide { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19V5a2 2 0 0 1 2-2h12v14H7a2 2 0 0 0-2 2 2 2 0 0 0 2 2h12M9 7h6' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.fund__ic--start { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM10 8.5v7l5.5-3.5L10 8.5Z' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* Copy buttons (.login) inside rows */
.kv .login { font-size: var(--acg-size-sm); font-variant-numeric: tabular-nums; }

/* Wider modal for tables and guides */
.mdl--wide { width: min(600px, calc(100% - 32px)); }
.ovl__body > .seg { margin-bottom: var(--acg-space-4); }
.t td.wrap { white-space: normal; line-height: 1.45; }
.mdl .tbl__wrap { margin: 0 calc(var(--acg-space-1) * -1); }

/* Numbered steps (guides, getting started) */
.steps { display: flex; flex-direction: column; gap: var(--acg-space-4); margin: 0; padding: 0; list-style: none; counter-reset: st; }
.steps li { position: relative; min-height: 24px; padding-left: 36px; color: var(--d-text-2); font-size: var(--acg-size-xs); line-height: 1.5; counter-increment: st; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: calc(var(--d-r-sm) - 2px); background: var(--d-ctl); color: var(--d-text); font-size: var(--acg-size-xs); font-weight: var(--acg-weight-medium); }
.steps b { display: block; margin-bottom: 2px; color: var(--d-text); font-size: var(--acg-size-sm); font-weight: var(--acg-weight-medium); }
.steps a { color: var(--d-text); }
.steps em { color: var(--d-text); font-style: normal; }
.steps .login { margin-top: var(--acg-space-1); }

/* ── Download platforms ── */
.pl-head { display: flex; align-items: center; gap: var(--acg-space-3); min-width: 0; }
.pl-head__logo { width: 40px; height: 40px; flex: none; border-radius: var(--d-r-sm); }
.pl-head h2 { font-size: var(--acg-size-md); }
.mt5 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--acg-space-4); }
.pl-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--acg-space-2); }
.pl-tile { display: flex; flex-direction: column; gap: var(--acg-space-4); padding: var(--acg-space-4); border-radius: var(--d-r-sm); background: var(--d-well); box-shadow: inset 0 0 0 1px transparent; }
.pl-tile.is-rec { box-shadow: inset 0 0 0 1px var(--d-accent-line); }
.pl-tile__top { display: flex; align-items: center; gap: var(--acg-space-3); min-width: 0; }
.pl-tile__top > span:nth-child(2) { flex: 1; min-width: 0; }
.pl-tile b { display: block; font-size: var(--acg-size-sm); font-weight: var(--acg-weight-medium); }
.pl-tile small { display: block; overflow: hidden; color: var(--d-muted); font-size: var(--acg-size-xs); text-overflow: ellipsis; white-space: nowrap; }
.pl-tile .btn { width: 100%; margin-top: auto; }
.pl-tile--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; }
.pl-tile--wide .pl-tile__top { flex: 1; }
.pl-tile--wide .btn { width: auto; margin: 0; }
.pl-login { display: flex; flex-direction: column; padding: var(--acg-space-4); border-radius: var(--d-r-sm); background: var(--d-well); }
.pl-login h3 { margin: 0; font-size: var(--acg-size-sm); font-weight: var(--acg-weight-medium); }
.pl-login > p { margin: 2px 0 var(--acg-space-2); color: var(--d-muted); font-size: var(--acg-size-xs); line-height: 1.5; }
.pl-login .kv--rows div { padding: 10px 0; }
.pl-login .kv dt { white-space: nowrap; }
.pl-login .pl-login__foot { margin: auto 0 0; padding-top: var(--acg-space-3); box-shadow: inset 0 1px 0 var(--d-line); color: var(--d-muted); font-size: var(--acg-size-xs); line-height: 1.5; }
.pl-login__foot a { color: var(--d-text); }
.pl-login .pl-login__none { margin: var(--acg-space-2) 0 var(--acg-space-4); }
.pl-login__none a { color: var(--d-text); }

/* Alpha Trader: the dashboard's dark Alpha Group card (.ins, --d-promo) */
.pl-at { gap: var(--acg-space-3); min-height: 300px; }
.pl-at > :not(.pl-at__art) { position: relative; }
.pl-at__wm { width: 140px; height: auto; }
.pl-at h3 { max-width: 230px; margin: var(--acg-space-3) 0 0; font-size: var(--acg-size-h4); font-weight: var(--acg-weight-regular); line-height: 1.2; letter-spacing: var(--acg-tracking-snug); }
.pl-at p { max-width: 230px; margin: 0; color: var(--d-on-accent-text); font-size: var(--acg-size-xs); line-height: 1.5; }
.pl-at__art { position: absolute; z-index: -1; top: 60px; right: -120px; width: 340px; max-width: none; height: auto; pointer-events: none; }
.pl-at .btn { margin-top: auto; }
.pl-at .btn:disabled { cursor: default; opacity: .85; }

/* cTrader: coming soon */
.pl-soon { display: flex; flex-direction: column; }
.pl-soon__txt { margin: 0 0 var(--acg-space-4); color: var(--d-text-2); font-size: var(--acg-size-xs); line-height: 1.6; }
.pl-chips { display: flex; flex-wrap: wrap; gap: var(--acg-space-2); margin-bottom: var(--acg-space-5); }
.pl-soon .btn { align-self: flex-start; margin-top: auto; }

/* Help row: cards that open modals */
.pl-help { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; }

/* ── Inbox ── */
.ib { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: var(--acg-space-4); align-items: stretch; }
.ib__list { display: flex; flex-direction: column; min-width: 0; min-height: 520px; padding: var(--acg-space-4); }
.ib__tools { display: flex; flex-direction: column; gap: var(--acg-space-3); margin-bottom: var(--acg-space-3); }
.ib__tools .search { width: 100%; }
.ib__tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ib__tabs::-webkit-scrollbar { display: none; }
.ib__tabs button { flex: none; }
.ib__tabs.is-more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.ib__tabs.is-more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px); mask-image: linear-gradient(90deg, transparent, #000 40px); }
.ib__tabs.is-more-l.is-more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.ib__undo { margin-bottom: var(--acg-space-3); }
.ib__items { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ib__item { display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: 0 10px; width: 100%; padding: 12px; border: 0; border-radius: var(--d-r-sm); background: transparent; color: var(--d-text-2); text-align: left; cursor: pointer; transition: background-color var(--acg-duration) var(--acg-ease); }
.ib__item:hover { background: color-mix(in srgb, var(--d-ctl) 55%, transparent); }
.ib__item[aria-selected="true"] { background: var(--d-ctl); }
.ib__item[aria-selected="true"] .tag { background: var(--d-ctl-2); }
.ib__item .dot { margin-top: 6px; visibility: hidden; }
.ib__item.is-unread .dot { visibility: visible; }
.ib__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ib__row { display: flex; align-items: center; justify-content: space-between; gap: var(--acg-space-2); min-width: 0; font-size: var(--acg-size-xs); }
.ib__from { overflow: hidden; color: var(--d-muted); text-overflow: ellipsis; white-space: nowrap; }
.ib__date { flex: none; color: var(--d-muted); font-variant-numeric: tabular-nums; }
.ib__subj { overflow: hidden; font-size: var(--acg-size-sm); text-overflow: ellipsis; white-space: nowrap; }
.ib__snip { flex: 1; min-width: 0; overflow: hidden; color: var(--d-muted); text-overflow: ellipsis; white-space: nowrap; }
.ib__row .tag { flex: none; }
.ib__item.is-unread .ib__from, .ib__item.is-unread .ib__subj { color: var(--d-text); }
.ib__item.is-unread .ib__subj { font-weight: var(--acg-weight-medium); }
.ib__list .empty, .ib__read .empty { flex: 1; justify-content: center; }
.ib__read { display: flex; flex-direction: column; min-width: 0; min-height: 520px; padding: var(--acg-space-6); }
.ib__back { display: none; align-self: flex-start; margin-bottom: var(--acg-space-4); }
.ib__meta { display: flex; align-items: center; gap: var(--acg-space-2); color: var(--d-muted); font-size: var(--acg-size-xs); }
.ib__read h2 { margin: var(--acg-space-3) 0 var(--acg-space-5); font-size: var(--acg-size-h4); font-weight: var(--acg-weight-regular); line-height: 1.25; letter-spacing: var(--acg-tracking-snug); }
.ib__who { display: flex; align-items: center; gap: var(--acg-space-3); padding-bottom: var(--acg-space-5); box-shadow: inset 0 -1px 0 var(--d-line); }
.ib__av { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--d-r-sm); background: var(--d-ctl); color: var(--d-text-2); font-size: var(--acg-size-xs); font-weight: var(--acg-weight-medium); }
.ib__who b { display: block; font-size: var(--acg-size-sm); font-weight: var(--acg-weight-medium); }
.ib__who small { display: block; color: var(--d-muted); font-size: var(--acg-size-xs); }
.ib__body { max-width: 70ch; margin: var(--acg-space-5) 0 0; color: var(--d-text-2); font-size: var(--acg-size-sm); line-height: 1.65; }
.ib__act { display: flex; flex-wrap: wrap; gap: var(--acg-space-2); margin-top: var(--acg-space-6); }

/* ── Giveaway terms ── */
.back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; color: var(--d-muted); font-size: var(--acg-size-xs); text-decoration: none; transition: color var(--acg-duration) var(--acg-ease); }
.back:hover { color: var(--d-text); }
/* Countdown strip: the dashboard giveaway card (.gw look), compact */
.gws { position: relative; isolation: isolate; display: flex; align-items: center; gap: var(--acg-space-6); padding: var(--acg-space-5) var(--acg-space-6); border-radius: var(--d-r); overflow: hidden; background: var(--d-giveaway); color: var(--acg-white); }
.gws > * { position: relative; }
.gws .gw__mark { position: absolute; height: 260%; right: -40px; }
.gws__txt { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: var(--acg-space-2); min-width: 0; }
.gws__txt b { font-size: var(--acg-size-md); font-weight: var(--acg-weight-medium); }
.gws .gw__clock { width: auto; margin: 0; padding: 0; }
.gws .gw__clock span { min-width: 64px; padding: 0 var(--acg-space-2); }
.gws .gw__clock b { font-size: var(--acg-size-h4); }
.gws .gw__clock small { margin-top: 4px; }
.gws .btn { flex: none; }
.gws .btn:disabled { cursor: default; opacity: .85; }
.tm { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--acg-space-4); align-items: start; }
.tm__toc { position: sticky; top: var(--acg-space-12); padding: var(--acg-space-3); }
.tm__toc summary { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 8px; color: var(--d-muted); font-size: var(--acg-size-xs); list-style: none; cursor: default; }
.tm__toc summary::-webkit-details-marker { display: none; }
.tm__toc summary .ic { display: none; transition: rotate .3s var(--acg-ease); }
.tm__toc nav { display: flex; flex-direction: column; gap: 2px; }
.tm__toc a { display: block; padding: 8px 10px; border-radius: var(--d-r-sm); color: var(--d-text-2); font-size: var(--acg-size-xs); text-decoration: none; transition: background-color var(--acg-duration) var(--acg-ease), color var(--acg-duration) var(--acg-ease); }
.tm__toc a:hover { background: color-mix(in srgb, var(--d-ctl) 55%, transparent); color: var(--d-text); }
.tm__toc a[aria-current="true"] { background: var(--d-ctl); color: var(--d-text); }
.tm__doc { padding: var(--acg-space-8); }
.tm__doc article { max-width: 70ch; }
.tm__doc section + section { margin-top: var(--acg-space-8); padding-top: var(--acg-space-8); box-shadow: inset 0 1px 0 var(--d-line); }
.tm__doc h2 { margin: 0 0 var(--acg-space-3); font-size: var(--acg-size-md); font-weight: var(--acg-weight-medium); scroll-margin-top: var(--acg-space-12); }
.tm__doc p { margin: 0 0 var(--acg-space-3); color: var(--d-text-2); font-size: var(--acg-size-sm); line-height: 1.7; }
.tm__doc p:last-child { margin-bottom: 0; }
.tm__doc a { color: var(--d-text); }
.tm__doc .note { margin-top: var(--acg-space-4); }
.tm__dates { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.tm__dates li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--acg-space-4); padding: var(--acg-space-3) 0; border-bottom: 1px solid var(--d-line); color: var(--d-text-2); font-size: var(--acg-size-sm); line-height: 1.6; }
.tm__dates li:last-child { border-bottom: 0; }
.tm__dates b { color: var(--d-text); font-weight: var(--acg-weight-medium); font-variant-numeric: tabular-nums; }
.tm__list { display: flex; flex-direction: column; gap: var(--acg-space-2); margin: 0; padding-left: 20px; color: var(--d-text-2); font-size: var(--acg-size-sm); line-height: 1.7; }

/* ── Responsive ── */
@media (max-width: 1240px) {
  .mt5 { grid-template-columns: minmax(0, 1fr); }
  /* Narrower card: a smaller phone, its flat bottom edge faded out */
  .pl-at__art { top: 24px; right: -96px; width: 220px; -webkit-mask-image: linear-gradient(#000 55%, transparent 95%); mask-image: linear-gradient(#000 55%, transparent 95%); }
  .pl-at h3, .pl-at p { max-width: 200px; }
  .gws { flex-wrap: wrap; }
  .gws__txt { flex-basis: 100%; }
  .gws .gw__clock { flex: 1; }
}
@media (max-width: 1240px) and (min-width: 641px) {
  .grid3 > .pl-help:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .ib { grid-template-columns: minmax(0, 1fr); }
  .ib__list, .ib__read { min-height: 0; }
  .ib__read, .ib.is-reading .ib__list { display: none; }
  .ib.is-reading .ib__read { display: flex; }
  .ib__back { display: inline-flex; }
  .tm { grid-template-columns: minmax(0, 1fr); }
  .tm__toc { position: static; }
  .tm__toc summary { padding-bottom: 6px; cursor: pointer; }
  .tm__toc summary .ic { display: inline-block; }
  .tm__toc[open] summary .ic { rotate: 180deg; }
  .tm__toc[open] summary { padding-bottom: 8px; }
}
@media (max-width: 640px) {
  .pl-head__tag { display: none; }
  .pl-tiles { grid-template-columns: minmax(0, 1fr); }
  .pl-tile.is-rec { order: -1; }
  .pl-tile--wide { flex-direction: column; align-items: stretch; }
  .pl-tile--wide .btn { width: 100%; }
  .ib__read { padding: var(--acg-space-4); }
  .tm__doc { padding: var(--acg-space-5) var(--acg-space-4); }
  .tm__dates li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gws { padding: var(--acg-space-5) var(--acg-space-4); gap: var(--acg-space-4); }
  .gws .gw__clock { flex-basis: 100%; }
  .gws .gw__clock span { min-width: 0; }
  .gws .btn { flex: 1; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .ib__item, .tm__toc a, .tm__toc summary .ic { transition: none; }
}
