/* /trade — terminal: main card (display, tools, chart, trades) + ticket (360px) */
.term { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.tm-main { border-radius: 40px; background: var(--ink-2); padding: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); min-width: 0; }
.tm-display { display: flex; align-items: center; gap: 20px; padding: 8px 12px 14px; }
.tm-market { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px 0 12px; border-radius: 24px; background: var(--ink-3); transition: background-color .2s; text-align: left; }
.tm-market:hover { background: #2a2a30; }
.tm-mname { display: grid; line-height: 1.2; } .tm-mname b { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; } .tm-mname small { font-size: 12px; color: var(--grey-2); }
.tm-market .chev { color: var(--grey-2); margin-left: 6px; }
.tm-price { display: flex; align-items: baseline; gap: 12px; }
.tm-price b { font-size: 40px; font-weight: 600; letter-spacing: -0.04em; color: #fff; transition: color .4s; }
.tm-price b.tick-up { color: #3ee39c; } .tm-price b.tick-down { color: #ff7a87; }
.tm-price span { font-size: 14px; } .up { color: #3ee39c; } .down { color: #ff7a87; }
.tm-exp { margin-left: auto; display: grid; justify-items: end; line-height: 1.1; padding-right: 8px; }
.tm-exp span { font-size: 12px; color: var(--grey-2); } .tm-exp b { font-size: 26px; font-weight: 600; color: var(--lav); }
.tm-exp b.blink { animation: blink .5s steps(2) infinite; } @keyframes blink { 50% { opacity: .35; } }
.tm-tools { display: flex; align-items: center; gap: 10px; padding: 0 4px 10px; }
.tm-tf { flex: none; } .tm-tf button { padding: 0 12px; }
.tm-ma { height: 42px; padding: 0 14px; border-radius: 16px; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 600; color: rgba(255,255,255,.55); }
.tm-ma.on { color: #bebeff; background: rgba(150,150,255,.14); }
.tm-clock { margin-left: auto; font-size: 13px; color: var(--lav); }
.tm-zoom { display: flex; gap: 4px; } .tm-zoom button { width: 38px; height: 38px; border-radius: 14px; background: rgba(255,255,255,.06); font-size: 18px; color: rgba(255,255,255,.75); }
.tm-chart { position: relative; height: 470px; border-radius: 30px; background: #151518; overflow: hidden; }
#kchart { position: absolute; inset: 8px 4px 4px 8px; }
.tm-chart-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 14px; color: var(--grey-2); background: rgba(18,18,20,.8); padding: 8px 14px; border-radius: 12px; }
.tm-trades { padding: 14px 4px 4px; }
.tm-tabs { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 6px; }
.tm-tabs .seg i { font-style: normal; display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 7px; background: rgba(56,26,201,.9); color: #fff; font-size: 11px; margin-left: 2px; }
.tm-tabs .seg button.on i { background: var(--indigo); }
.tm-stake-meta { font-size: 13px; color: var(--grey-2); } .tm-stake-meta b { color: #fff; font-weight: 600; margin-left: 4px; }
.tr { display: grid; grid-template-columns: 1.3fr .8fr 1fr 1fr .8fr .8fr .7fr 1.2fr 1.3fr; align-items: center; gap: 8px; padding: 12px 12px; border-radius: 18px; font-size: 14px; }
.tr:not(.tr-h):hover { background: rgba(255,255,255,.03); }
.tr-h { font-size: 12px; color: var(--grey-2); padding-top: 6px; padding-bottom: 6px; }
.tr.lost > span:not(.tr-m):not(:nth-child(8)) { color: rgba(255,255,255,.4); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.25); }
.tr-m { display: flex; align-items: center; gap: 8px; font-weight: 600; } .tr-m img { width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.tr .lock { font-style: normal; color: var(--lav); }
.tr-act { display: flex; justify-content: flex-end; gap: 6px; }
.tr-act button { height: 32px; padding: 0 10px; border-radius: 11px; background: rgba(22,199,132,.16); color: #3ee39c; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tr-act button.ic { width: 32px; padding: 0; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; }
.tm-pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 8px; font-size: 13px; color: var(--grey-2); }
.tm-pager button { width: 32px; height: 32px; border-radius: 11px; background: rgba(255,255,255,.06); color: #fff; }

/* ticket */
.tm-ticket { position: sticky; top: 96px; border-radius: 40px; background: var(--ink-2); padding: 24px; display: grid; gap: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.tk-head { display: flex; justify-content: space-between; align-items: baseline; }
.tk-head b { font-size: 22px; font-weight: 600; } .tk-head span { font-size: 14px; color: var(--grey-2); } .tk-head em { font-style: normal; font-size: 22px; font-weight: 600; color: #3ee39c; margin-left: 4px; }
.tk-field { display: grid; gap: 8px; } .tk-field > span { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: rgba(255,255,255,.75); } .tk-field small { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--grey-2); }
.tk-select { position: relative; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px; border-radius: 20px; background: var(--ink-3); color: var(--lav); }
.tk-select select { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; color: #fff; font-size: 18px; font-weight: 600; appearance: none; -webkit-appearance: none; cursor: pointer; }
.tk-select select option { background: #212124; color: #fff; }
.tk-select::after { content: ''; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid #8f8f8f; border-bottom: 2px solid #8f8f8f; transform: rotate(45deg); pointer-events: none; }
.tk-stake { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 0 0 16px; border-radius: 20px; background: var(--ink-3); font-size: 18px; color: var(--grey-2); overflow: hidden; }
.tk-stake input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 24px; font-weight: 600; color: #fff; }
.tk-pm { display: grid; height: 100%; border-left: 1px solid rgba(255,255,255,.06); } .tk-pm button { width: 44px; color: #fff; font-size: 16px; } .tk-pm button + button { border-top: 1px solid rgba(255,255,255,.06); }
.tk-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tk-chips button { height: 36px; border-radius: 12px; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 600; color: rgba(255,255,255,.85); }
.tk-chips button:hover { background: rgba(255,255,255,.12); }
.tk-win { display: grid; gap: 4px; padding: 16px 18px; border-radius: 24px; background: #bebeff; color: var(--ink); }
.tk-win > span { font-size: 12px; font-weight: 600; text-transform: uppercase; color: #3a3a55; }
.tk-win b { font-size: 36px; font-weight: 600; letter-spacing: -0.04em; }
.tk-win small { font-size: 13px; color: #3a3a55; } .tk-win .up { color: #0b8a57; font-style: normal; }
.tk-calls { display: grid; gap: 8px; }
.tk-calls button { display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 20px; border-radius: 24px; color: #fff; text-align: left; transition: transform .3s var(--spring), filter .2s, opacity .2s; }
.tk-calls svg { width: 24px; height: 24px; flex: none; }
.tk-calls span { display: grid; line-height: 1.15; } .tk-calls b { font-size: 22px; font-weight: 600; } .tk-calls small { font-size: 12px; opacity: .8; }
.tk-up { background: linear-gradient(#1fd08e, #0e9c63); box-shadow: 0 10px 24px rgba(14,156,99,.25), inset 0 1px 0 rgba(255,255,255,.3); }
.tk-down { background: linear-gradient(#ff6b78, #e0394b); box-shadow: 0 10px 24px rgba(224,57,75,.25), inset 0 1px 0 rgba(255,255,255,.3); }
.tk-calls button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.tk-calls button:disabled { opacity: .35; cursor: default; }
.tk-calls button.busy { opacity: .7; pointer-events: none; }
.tk-calls button.flash { animation: flash .6s ease-in-out 4; } @keyframes flash { 50% { filter: brightness(1.5); transform: scale(1.02); } }
.tk-block { padding: 12px 14px; border-radius: 16px; background: rgba(255,186,73,.1); color: #ffd28a; font-size: 13px; line-height: 19px; }
.tk-block a, .tk-block button { color: #fff; font-weight: 600; text-decoration: underline; }
.tk-rule { font-size: 12.5px; line-height: 18px; color: var(--grey-2); }
.tk-quest { font-size: 13px; color: var(--lav); }
.tk-foot { font-size: 12px; color: var(--grey-2); border-top: 1px solid rgba(255,255,255,.06); padding-top: 12px; }

/* market popover */
.mk-pop { position: fixed; inset: 0; z-index: 60; background: rgba(8,8,12,.35); }
.mk-card { position: absolute; left: max(24px, calc(50% - 696px)); top: 196px; width: 440px; max-height: calc(100vh - 220px); overflow: auto; border-radius: 32px; background: #1f1f23; padding: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.06); animation: toastIn .35s var(--spring); }
.mk-cats i { font-style: normal; opacity: .55; margin-left: 2px; }
.mk-list { display: grid; gap: 2px; margin-top: 10px; }
.mk-row { display: grid; grid-template-columns: 32px 1fr auto 56px; align-items: center; gap: 12px; height: 58px; padding: 0 12px; border-radius: 18px; text-align: left; }
.mk-row:hover, .mk-row.on { background: rgba(255,255,255,.06); }
.mk-row img { width: 32px; height: 32px; border-radius: 50%; background: #fff; object-fit: cover; }
.mk-n { display: grid; line-height: 1.2; } .mk-n b { font-size: 15px; } .mk-n small { font-size: 12px; color: var(--grey-2); }
.mk-row.off .mk-n small { color: #ffb86b; }
.mk-p { font-size: 14px; } .mk-row em { font-style: normal; text-align: right; font-size: 13px; font-weight: 600; color: #3ee39c; }
.mk-row:disabled { opacity: .45; }

/* share sheet */
.share-img { width: 100%; border-radius: 22px; margin-top: 16px; aspect-ratio: 1200 / 630; background: #151518; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }

@media (max-width: 1100px) {
  .term { grid-template-columns: 1fr; }
  .tm-ticket { position: relative; top: auto; }
  .tm-chart { height: 340px; }
  .tr { grid-template-columns: 1.2fr .8fr 1fr 1fr 1fr; } .tr > span:nth-child(5), .tr > span:nth-child(6), .tr > span:nth-child(7) { display: none; }
}
@media (max-width: 760px) {
  .tm-main { border-radius: 28px; padding: 8px; }
  .tm-display { flex-wrap: wrap; gap: 10px; padding: 6px 6px 10px; }
  .tm-market { height: 56px; } .tm-price b { font-size: 30px; }
  .tm-tools { overflow-x: auto; } .tm-clock { display: none; }
  .tm-chart { height: 300px; border-radius: 22px; }
  .tr { grid-template-columns: 1fr auto; grid-auto-flow: row; gap: 4px 8px; padding: 12px; background: rgba(255,255,255,.03); margin-bottom: 6px; }
  .tr-h { display: none; }
  .tr > span:nth-child(n) { display: block; }
  .tr > span:nth-child(3)::before { content: 'Entry '; color: var(--grey-2); } .tr > span:nth-child(4)::before { content: 'Close '; color: var(--grey-2); }
  .tr > span:nth-child(5), .tr > span:nth-child(6), .tr > span:nth-child(7) { display: none; }
  .tm-ticket { border-radius: 28px; padding: 18px; }
  .mk-card { left: 12px; right: 12px; width: auto; top: 140px; }
}
