/* Look: the approved clickable mockup (Design canvas "Port Tracker"): near-black grid ground, cyan + violet accents,
 * glass cards, Chakra Petch for numbers/headings, IBM Plex Sans Thai body, floating 5-slot dock with a centre + button.
 * Themes: default = Neon, [data-theme="solar"], [data-theme="plasma"]. Motion is transform/opacity only and stops
 * with prefers-reduced-motion (end of file). */

:root {
  --bg: #03060d;
  --a1: #3df5ff;
  --a1-rgb: 61 245 255;
  --a2: #8b7cff;
  --a2-rgb: 139 124 255;
  --grad: linear-gradient(90deg, var(--a1), var(--a2));
  --grad-135: linear-gradient(135deg, var(--a1), var(--a2));
  --on-grad: #04101a;
  --text: #e6f1ff;
  --soft: #b7c6da;
  --muted: #8fa3bf;
  --line: rgb(143 163 191 / .16);
  --line-2: rgb(143 163 191 / .1);
  --card: rgb(10 17 31 / .82);
  --card-2: rgb(12 20 36 / .8);
  --glass: linear-gradient(160deg, rgb(20 32 56 / .86), rgb(8 13 26 / .92));
  --solid: #070c17;
  --up: #29e39a;
  --down: #ff5470;
  --warn: #ffd166;
  --up-bg: rgb(41 227 154 / .12);
  --down-bg: rgb(255 84 112 / .12);
  --flat-bg: rgb(143 163 191 / .1);
  --head: 'Chakra Petch', 'IBM Plex Sans Thai', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --col: 480px;
  color-scheme: dark;
}
:root[data-theme="solar"] {
  --a1: #ffd166; --a1-rgb: 255 209 102;
  --a2: #ff9f43; --a2-rgb: 255 159 67;
  --on-grad: #1b1000;
}
:root[data-theme="plasma"] {
  --a1: #ff5fa2; --a1-rgb: 255 95 162;
  --a2: #8b7cff; --a2-rgb: 139 124 255;
  --on-grad: #16051a;
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #020409; }
html, body { margin: 0; color: var(--text); }
body { font-family: 'IBM Plex Sans Thai', -apple-system, system-ui, sans-serif; font-size: 15px; min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--a1); text-decoration: none; }
.num, .h { font-family: var(--head); }
.num { font-variant-numeric: tabular-nums; }
.up-t { color: var(--up); }
.down-t { color: var(--down); }
.flat-t { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mask .m { filter: blur(9px); }

.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; background-color: var(--bg);
  background-image:
    radial-gradient(520px 360px at 85% -8%, rgb(var(--a2-rgb) / .3), transparent 70%),
    radial-gradient(460px 340px at -10% 30%, rgb(var(--a1-rgb) / .15), transparent 70%),
    linear-gradient(rgb(61 245 255 / .045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(61 245 255 / .045) 1px, transparent 1px);
  background-size: auto, auto, 26px 26px, 26px 26px;
}
.shell { position: relative; z-index: 1; max-width: var(--col); margin: 0 auto; min-height: 100dvh; }
@media (min-width: 700px) { .shell { border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); } }

.view { display: none; padding: calc(22px + var(--safe-t)) 18px calc(120px + var(--safe-b)); flex-direction: column; gap: 16px; }
.view.active { display: flex; animation: viewIn .28s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* page title: // TAG over a big Thai title */
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ph > div { display: flex; flex-direction: column; min-width: 0; }
.tag { font: 500 11px/1.4 var(--head); letter-spacing: .22em; color: var(--a1); }
.ph h1 { margin: 0; font: 700 26px/1.25 var(--head); }
.sh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 2px; }
.sh h2 { margin: 0; font: 600 13px var(--head); letter-spacing: .2em; color: var(--a1); }
.sh .more { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--a1); padding: 0; }
.sh small { font-size: 12px; color: var(--muted); }
.sub-h { margin: 4px 2px -4px; font-size: 15px; font-weight: 600; }

/* pills and badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font: 600 11px var(--head); letter-spacing: .06em; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.live { color: var(--up); border-color: rgb(41 227 154 / .35); background: rgb(41 227 154 / .08); }
.pill.warn { color: var(--warn); border-color: rgb(255 209 102 / .35); }
.pill.err { color: var(--down); border-color: rgb(255 84 112 / .35); }
.blip { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.badge { font: 700 9px var(--head); letter-spacing: .08em; padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor; color: var(--muted); white-space: nowrap; flex: none; }
.badge.live { color: var(--up); }
.badge.delay { color: var(--warn); }
.ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgb(255 255 255 / .04); border: 1px solid var(--k, var(--line)); color: var(--k, var(--soft)); font: 700 12px var(--head); }

/* buttons */
.btn { height: 48px; border-radius: 14px; border: 1px solid rgb(var(--a1-rgb) / .4); background: rgb(var(--a1-rgb) / .06); color: var(--text); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding: 0 14px; }
.btn svg { color: var(--a1); }
.btn.primary { border: 0; background: var(--grad); color: var(--on-grad); box-shadow: 0 0 24px rgb(var(--a1-rgb) / .35); }
.btn.primary svg { color: currentColor; }
.btn.danger { border-color: rgb(255 84 112 / .4); background: rgb(255 84 112 / .08); color: var(--down); }
.btn.ghost { border-color: var(--line); background: transparent; color: var(--soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; cursor: pointer; background: rgb(255 255 255 / .04); border: 1px solid rgb(143 163 191 / .22); color: var(--text); position: relative; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #ff5fa2; box-shadow: 0 0 8px #ff5fa2; }

.card { border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.card.pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.glass { position: relative; border-radius: 24px; padding: 18px; background: var(--glass); border: 1px solid rgb(var(--a1-rgb) / .22); box-shadow: inset 0 0 0 1px rgb(var(--a2-rgb) / .08), 0 20px 60px rgb(0 0 0 / .5); overflow: hidden; }
.glass > * { position: relative; }
.glass .sweep { position: absolute; top: 0; left: 0; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, rgb(var(--a1-rgb) / .07), transparent); animation: sweep 5s linear infinite; pointer-events: none; }
@keyframes sweep { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
.note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; line-height: 1.7; }

/* ---------- lobby ---------- */
.hello { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 14px; padding: 2px; background: conic-gradient(from 0deg, var(--a1), var(--a2), #ff5fa2, var(--a1)); }
.avatar span { width: 100%; height: 100%; border-radius: 12px; background: var(--solid); display: grid; place-items: center; font: 700 17px var(--head); color: var(--a1); }
.hello .who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hello .who small { font-size: 12px; color: var(--muted); }
.hello .who b { font: 600 19px var(--head); letter-spacing: .02em; }

.nw-head { display: flex; justify-content: space-between; align-items: center; }
.eye { width: 44px; height: 32px; border-radius: 10px; border: 1px solid rgb(143 163 191 / .25); background: rgb(255 255 255 / .04); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.nw { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.holo { position: relative; width: 150px; height: 150px; flex: none; }
.holo svg { position: absolute; inset: 0; }
.holo .r1 { animation: spin 40s linear infinite; }
.holo .r2 { animation: spin 26s linear infinite reverse; }
.holo .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.holo .mid b { font: 700 30px/1 var(--head); }
.holo .mid small { font-size: 11px; color: var(--muted); margin-top: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.nw-vals { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nw-total { font: 700 clamp(19px, 6.4vw, 27px)/1.15 var(--head); letter-spacing: .01em; text-shadow: 0 0 22px rgb(var(--a1-rgb) / .35); white-space: nowrap; }
.nw-day { font: 600 14px var(--head); }
.nw-pl { margin-top: 6px; padding: 6px 10px; border-radius: 10px; font-size: 12px; background: rgb(255 255 255 / .04); border: 1px solid var(--line); }
.nw-pl.up { background: rgb(41 227 154 / .08); border-color: rgb(41 227 154 / .22); }
.nw-pl.down { background: rgb(255 84 112 / .08); border-color: rgb(255 84 112 / .22); }
.nw-pl span { color: var(--muted); }
.nw-pl b { font-family: var(--head); }
.glass .btn-row { margin-top: 16px; }

.tape { margin: 0 -18px; overflow: hidden; border-top: 1px solid rgb(var(--a1-rgb) / .14); border-bottom: 1px solid rgb(var(--a1-rgb) / .14); background: rgb(5 10 20 / .6); }
.tape-run { display: flex; width: max-content; animation: marquee 30s linear infinite; font: 13px var(--head); }
.tape-run span { padding: 9px 14px; white-space: nowrap; border-right: 1px solid rgb(143 163 191 / .12); color: var(--muted); }
.tape-run b { color: var(--text); font-weight: 600; }
@keyframes marquee { to { transform: translateX(-50%); } }

.matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; background: rgb(12 20 36 / .72); border: 1px solid var(--line); color: var(--text); overflow: hidden; cursor: pointer; text-align: left; transition: transform .2s, border-color .2s; }
.tile:hover { border-color: rgb(var(--a1-rgb) / .55); transform: translateY(-2px); }
.tile .glow { position: absolute; top: -30px; right: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--k); opacity: .25; filter: blur(18px); }
.tile .top { display: flex; align-items: center; justify-content: space-between; }
.tile .code { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgb(255 255 255 / .05); border: 1px solid var(--k); color: var(--k); font: 700 13px var(--head); }
.tile .chg { font: 600 12px var(--head); }
.tile .nm { font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .val { font: 600 18px var(--head); white-space: nowrap; }
.tile .val.none { font-size: 13px; font-family: inherit; font-weight: 400; color: var(--muted); }
.tile .bar { height: 3px; border-radius: 2px; background: rgb(255 255 255 / .07); }
.tile .bar i { display: block; height: 3px; border-radius: 2px; background: var(--k); box-shadow: 0 0 8px var(--k); }

/* list rows shared by movers, market, holdings */
.rows { display: flex; flex-direction: column; overflow: hidden; }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; color: var(--text); }
.row:last-child { border-bottom: 0; }
.row:hover { background: rgb(var(--a1-rgb) / .05); }
.row .mid { display: flex; flex-direction: column; min-width: 0; }
.row .sym { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row .sym b { font: 600 15px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .name > .b { flex: none; display: inline-flex; }
#mList .row .name { display: flex; align-items: center; gap: 6px; }
#mList .row .name > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.row .name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .px { font: 600 15px var(--head); padding: 3px 6px; border-radius: 6px; text-align: right; transition: background .5s; white-space: nowrap; }
.row .px.flash-up { background: rgb(41 227 154 / .16); transition: none; }
.row .px.flash-down { background: rgb(255 84 112 / .14); transition: none; }
.chg { min-width: 74px; text-align: center; padding: 6px 0; border-radius: 9px; font: 600 13px var(--head); white-space: nowrap; }
.chg.up { color: var(--up); background: var(--up-bg); }
.chg.down { color: var(--down); background: var(--down-bg); }
.chg.flat { color: var(--muted); background: var(--flat-bg); }
.row.mv { grid-template-columns: 40px minmax(0, 1fr) auto; }
.row.mv .r { display: flex; flex-direction: column; align-items: flex-end; min-width: 78px; }
.row.mv .r b { font: 600 15px var(--head); white-space: nowrap; }
.row.mv .r span { font: 600 12px var(--head); }
.held { color: var(--a1); font-size: 10px; flex: none; }

/* ---------- market ---------- */
.search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--card-2); border: 1px solid rgb(143 163 191 / .2); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: rgb(var(--a1-rgb) / .5); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: 13px; border: 1px solid rgb(143 163 191 / .22); background: var(--card-2); color: var(--soft); }
.chip.on { border-color: transparent; background: var(--grad); color: var(--on-grad); box-shadow: 0 0 18px rgb(var(--a1-rgb) / .35); }
.cols { display: grid; grid-template-columns: 1fr auto 74px; gap: 12px; padding: 0 4px; margin-bottom: -6px; font: 11px var(--head); letter-spacing: .12em; color: var(--muted); }
.cols span:last-child { text-align: right; }

/* ---------- portfolio ---------- */
.sum { border-color: rgb(41 227 154 / .25); display: flex; flex-direction: column; gap: 10px; }
.sum.down { border-color: rgb(255 84 112 / .25); }
.sum .lbl { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.sum .big { font: 700 clamp(24px, 8vw, 32px)/1.15 var(--head); text-shadow: 0 0 24px rgb(41 227 154 / .3); white-space: nowrap; }
.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat3 div { padding: 9px 10px; border-radius: 12px; background: rgb(255 255 255 / .04); display: flex; flex-direction: column; min-width: 0; }
.stat3 small { font-size: 11px; color: var(--muted); }
.stat3 b { font: 600 14px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat3 span { font: 11px var(--head); }
.seg { display: flex; padding: 3px; border-radius: 11px; background: rgb(255 255 255 / .05); }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; cursor: pointer; font-size: 12px; background: transparent; color: var(--soft); }
.seg button.on { background: var(--grad); color: var(--on-grad); }
.abar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.abar i { display: block; height: 100%; transform-origin: left; animation: grow .6s ease-out; }
@keyframes grow { from { transform: scaleX(0); } }
.alist { display: flex; flex-direction: column; gap: 9px; }
.alist div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 52px; align-items: center; gap: 10px; font-size: 13px; }
.alist i { width: 10px; height: 10px; border-radius: 3px; }
.alist span { color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alist b { font: 500 13px var(--head); white-space: nowrap; }
.alist b:last-child { font-weight: 600; text-align: right; }
.row.hold { grid-template-columns: 4px minmax(0, 1fr) auto; padding-left: 0; gap: 12px; }
.row.hold .stripe { height: 36px; border-radius: 0 3px 3px 0; background: var(--k); box-shadow: 0 0 8px var(--k); }
.row.hold .r { display: flex; flex-direction: column; align-items: flex-end; }
.row.hold .r b { font: 600 15px var(--head); white-space: nowrap; }
.row.hold .r span { font: 600 12px var(--head); white-space: nowrap; }

/* ---------- dock ---------- */
.dock {
  position: fixed; z-index: 10; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + var(--safe-b)); width: calc(min(100vw, var(--col)) - 24px); height: 68px; border-radius: 24px;
  background: rgb(8 14 26 / .78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgb(var(--a1-rgb) / .2); box-shadow: 0 10px 40px rgb(0 0 0 / .6);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
}
.dock button { border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 4px 0; }
.dock button.active { color: var(--a1); }
.dock .dock-add { justify-self: center; width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; padding: 0; display: grid; place-items: center; background: var(--grad-135); color: var(--on-grad); box-shadow: 0 0 0 5px var(--bg), 0 0 28px rgb(var(--a1-rgb) / .55); }

/* ---------- sheets (asset detail, add) ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgb(0 0 0 / .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: var(--col); margin: 0 auto; max-height: 94dvh; overflow-y: auto;
  border-radius: 26px 26px 0 0; padding: 6px 18px calc(24px + var(--safe-b));
  background-color: var(--bg);
  background-image: radial-gradient(500px 340px at 50% -10%, rgb(var(--k-rgb, var(--a1-rgb)) / .2), transparent 70%), linear-gradient(rgb(61 245 255 / .04) 1px, transparent 1px), linear-gradient(90deg, rgb(61 245 255 / .04) 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
  border-top: 1px solid rgb(var(--a1-rgb) / .25); animation: up .24s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: rgb(143 163 191 / .3); margin: 6px auto 14px; }
#sheetBody { display: flex; flex-direction: column; gap: 14px; }

.d-head { display: flex; align-items: center; gap: 12px; }
.d-head .ico { width: 44px; height: 44px; border-radius: 14px; font-size: 15px; box-shadow: 0 0 18px color-mix(in srgb, var(--k) 30%, transparent); }
.d-head .t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.d-head .t b { font: 700 20px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-head .t span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-price b { font: 700 clamp(28px, 9vw, 38px)/1.15 var(--head); letter-spacing: .01em; }
.d-chg { font: 600 15px var(--head); }
.d-chg small { font: 13px 'IBM Plex Sans Thai', sans-serif; color: var(--muted); margin-left: 4px; }
.d-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chart { position: relative; height: 210px; margin: 0 -6px; border-radius: 18px; background: linear-gradient(180deg, rgb(10 17 31 / .2), rgb(10 17 31 / .75)); border: 1px solid rgb(143 163 191 / .12); overflow: hidden; touch-action: none; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart polyline { filter: drop-shadow(0 0 6px currentColor); }
.chart-base { stroke: rgb(143 163 191 / .18); stroke-dasharray: 3 4; }
.chart-cross { stroke: rgb(230 241 255 / .35); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-label { fill: var(--muted); font-size: 10px; font-family: var(--head); }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.ranges { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--card-2); border: 1px solid rgb(143 163 191 / .14); }
.ranges button { height: 36px; border-radius: 10px; border: 0; cursor: pointer; font: 600 13px var(--head); background: transparent; color: var(--muted); }
.ranges button.on { background: linear-gradient(90deg, rgb(var(--a1-rgb) / .25), rgb(var(--a2-rgb) / .25)); color: var(--text); }
.pos { border-radius: 20px; padding: 16px; background: var(--glass); border: 1px solid rgb(var(--a1-rgb) / .22); display: flex; flex-direction: column; gap: 12px; }
.pos .ph2 { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid2 div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.grid2 small { font-size: 12px; color: var(--muted); }
.grid2 b { font: 600 17px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* trade panel (buy more / sell / set) */
.trade-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trade-tabs button { height: 38px; font-size: 14px; font-weight: 600; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg.small button { flex: 1; font-size: 12px; }
.tprev { border-radius: 16px; padding: 14px; background: var(--glass); border: 1px solid rgb(var(--a1-rgb) / .25); display: flex; flex-direction: column; gap: 12px; }
.tp-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 6px 0; }
.tp-main { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.tp-main div { display: flex; flex-direction: column; min-width: 0; }
.tp-main small, .tprev .grid2 small { font-size: 11.5px; color: var(--muted); }
.tp-main b { font: 600 17px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-main b.hl { font-size: 21px; color: var(--a1); text-shadow: 0 0 16px rgb(var(--a1-rgb) / .45); }
.tp-main span { font: 600 12px var(--head); }
.tp-main .arrow { font-size: 20px; color: var(--muted); }
.tprev .grid2 b { font-size: 15px; }
.tprev .grid2 small + b + small { font-size: 11px; }
.tp-foot { font-size: 12.5px; color: var(--soft); border-top: 1px solid var(--line-2); padding-top: 10px; }
.tp-foot b { font-family: var(--head); color: var(--text); }
.target { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; font-size: 13px; color: var(--soft); }
.target input { height: 40px !important; }
.target .tt { grid-column: 1 / -1; font-size: 12.5px; color: var(--soft); }
.target .tt:empty { display: none; }
.target b { font-family: var(--head); color: var(--a1); }
.link { border: 0; background: none; padding: 0 0 0 6px; color: var(--a1); cursor: pointer; text-decoration: underline; font-size: 12.5px; }
.chips-mini { display: flex; gap: 8px; }
.chips-mini .chip { height: 32px; }
.hist { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.hist:last-child { border-bottom: 0; }
.hist .chg { min-width: 0; padding: 4px 0; font-size: 12px; }
.hist .mid { display: flex; flex-direction: column; min-width: 0; }
.hist .mid b { font: 600 13.5px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist .name { font-size: 11.5px; color: var(--muted); }
.hist > b { font: 600 13.5px var(--head); white-space: nowrap; }

/* forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form input, .form select, .set-row input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--card-2); border: 1px solid rgb(143 163 191 / .2);
  color: var(--text); font-size: 16px; font-family: var(--head); outline: none;
}
.form input:focus, .set-row input:focus { border-color: rgb(var(--a1-rgb) / .6); box-shadow: 0 0 0 3px rgb(var(--a1-rgb) / .12); }
.form select option { background: var(--solid); }
.form .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.step { font: 500 12px var(--head); letter-spacing: .12em; color: var(--muted); margin-bottom: -4px; }
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kinds button { height: 74px; border-radius: 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--text); background: rgb(10 17 31 / .85); border: 1px solid rgb(143 163 191 / .18); }
.kinds button span { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--k); color: var(--k); font: 700 12px var(--head); }
.kinds button.on { border-color: var(--k); background: rgb(var(--a1-rgb) / .09); box-shadow: 0 0 20px color-mix(in srgb, var(--k) 35%, transparent); }
.results { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.result { display: flex; gap: 10px; align-items: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; cursor: pointer; text-align: left; color: var(--text); }
.result img { width: 36px; height: 50px; object-fit: cover; border-radius: 4px; }
.result.on { border-color: var(--a1); box-shadow: 0 0 0 1px var(--a1); }
.search-btn { display: flex; gap: 8px; }
.search-btn input { flex: 1; }
.search-btn .btn { flex: none; }

/* ---------- settings ---------- */
.set-list { display: flex; flex-direction: column; overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line-2); }
.set-row:last-child { border-bottom: 0; }
.set-row .t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.set-row .t b { font-size: 14px; font-weight: 600; }
.set-row .t span { font-size: 12px; color: var(--muted); }
.set-row input { width: 46%; height: 40px; flex: none; }
.set-row .src-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--k); box-shadow: 0 0 8px var(--k); }
.set-row .st { font: 600 11px var(--head); color: var(--k); white-space: nowrap; }
.soon { font: 600 10px var(--head); letter-spacing: .08em; padding: 3px 7px; border-radius: 999px; border: 1px solid rgb(var(--a2-rgb) / .5); color: var(--a2); white-space: nowrap; }
.switch { width: 50px; height: 30px; flex: none; border-radius: 999px; border: 0; padding: 3px; cursor: pointer; display: flex; background: rgb(143 163 191 / .25); }
.switch i { width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--grad); }
.switch.on i { transform: translateX(20px); }
.switch:disabled { opacity: .4; cursor: not-allowed; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.themes button { border-radius: 16px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text); background: rgb(10 17 31 / .85); border: 1px solid rgb(143 163 191 / .18); }
.themes button i { display: block; height: 28px; border-radius: 9px; }
.themes button.on { border-color: var(--a1); box-shadow: 0 0 18px rgb(var(--a1-rgb) / .35); }
.alert-ph { display: flex; gap: 12px; align-items: center; padding: 14px; }
.alert-ph .ico { --k: var(--a2); }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 30; padding: 10px 16px; border-radius: 12px; font-size: 14px; background: var(--solid); border: 1px solid rgb(var(--a1-rgb) / .35); box-shadow: 0 0 24px rgb(var(--a1-rgb) / .25); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
