:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #192823;
  background: #f4f5ef;
  font-synthesis: none;
  --line: #d7dcd1;
  --muted: #51625a;
  --ink: #192823;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after {box-sizing: border-box}
html {overscroll-behavior-y: none}
body {margin: 0; -webkit-font-smoothing: antialiased}
button, input, select {font: inherit}
button, a {touch-action: manipulation; -webkit-tap-highlight-color: transparent}
button {color: inherit; cursor: pointer}
a {color: inherit}
:focus-visible {outline: 3px solid #ac6000; outline-offset: 4px}
[hidden], .symbols {display: none !important}
.icon {width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none}
.appbar {border-bottom: 1px solid var(--line); background: #fcfcf8}
.bar-inner, .shell {width: min(100% - 72px, 920px); margin-inline: auto}
.bar-inner {height: 71px; display: flex; align-items: center; justify-content: space-between}
.bar-actions {display: flex; align-items: center; gap: 7px}
.refresh-feedback {position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 50%; transform: translateX(-50%); z-index: 5; pointer-events: none; border-radius: 24px; color: #fff; background: #263e33; box-shadow: 0 2px 10px #10261930; font-size: 13px; line-height: 1.5; text-align: center}
.refresh-feedback:not(:empty) {padding: 8px 16px}
.refresh-feedback[data-state="ready"] {color: #def783}
.refresh-feedback[data-state="error"] {background: #783f30}
@media (prefers-reduced-motion: no-preference) {
  #refresh-feed[disabled] .icon {animation: refresh-turn 1s linear infinite}
  @keyframes refresh-turn {to {transform: rotate(360deg)}}
}
.brand {display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: .045em; text-decoration: none; font-size: 23px}
.brand-icon, .dialog-symbol {display: grid; place-items: center; background: #244035; color: #def783; border-radius: 9px}
.brand-icon {width: 36px; height: 36px}
.brand-icon svg {width: 30px; height: 30px}
.settings-button, .source {display: inline-flex; align-items: center; justify-content: center; gap: 7px}
.settings-button {min-height: 42px; border: 1px solid #cbd2c6; border-radius: 8px; padding: 0 13px; background: #fcfcf8; font-size: 13px; font-weight: 650}
.settings-button .icon {width: 16px; height: 16px}
.settings-button:hover {background: #f0f2e9}
#notify-indicator {width: 6px; height: 6px; border-radius: 50%; background: #3d804d}
.shell {padding: 30px 0 max(54px, env(safe-area-inset-bottom))}
.hero {position: relative; overflow: hidden; isolation: isolate; border-radius: 17px; color: #fbfcf6; background: #19372d; padding: 24px 32px 23px}
.hero::before {content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, #162c25 2%, #1a392f 56%, #2e4f3c)}
.hero-art {position: absolute; z-index: -1; inset: 0 0 0 35%; overflow: hidden; opacity: .8; background-image: linear-gradient(90deg, transparent 27px, #bad6b818 28px), linear-gradient(transparent 27px, #bad6b818 28px); background-size: 28px 28px; mask-image: linear-gradient(to right, transparent, #000 30%)}
.orbit, .orbit-middle, .orbit-core {display: grid; place-items: center; border: 1px solid #b7d4a333; border-radius: 50%}
.orbit {position: absolute; width: 245px; aspect-ratio: 1; top: 50%; right: 9%; transform: translateY(-50%)}
.orbit::after {content: ""; position: absolute; inset: 10px; border: 1px dashed #b7d4a329; border-radius: 50%}
.orbit-middle {width: 73%; aspect-ratio: 1; border-color: #bedba848}
.orbit-core {width: 70%; aspect-ratio: 1; background: #38554152; border-color: #bedba83d}
.orbit-core svg {width: 69%; height: 69%; color: #b9d79170}
.hero-top {display: flex; align-items: center; justify-content: space-between; gap: 12px}
.venue {display: inline-flex; align-items: center; gap: 9px; font-weight: 620; font-size: 12px; letter-spacing: .09em; color: #dce5d5}
.source {color: #d4dfcf; font-size: 12px; text-decoration: none; border: 0; background: #1b352bd9; border-radius: 6px; min-height: 32px; padding: 0 8px}
.source:hover {color: #f1ffb7}
.source .icon {width: 13px; height: 13px}
h1, h2, p {margin: 0}
h1 {font-size: clamp(37px, 5.5vw, 54px); font-weight: 700; letter-spacing: .015em; margin: 11px 0 10px; line-height: 1.15}
.status {display: inline-flex; align-items: center; gap: 7px; color: #e0e6d4; font-size: 12px; font-weight: 550}
.status i {width: 7px; height: 7px; background: #c1c9ba; border-radius: 50%}
.status[data-state="ok"] i {background: #ccec7d; box-shadow: 0 0 0 3px #ccec7d1f}
.status[data-state="stale"] i {background: #f1bc71}
.status[data-state="error"] i {background: #f6a18c}
.metrics {border-top: 1px solid #c8d6bc31; display: flex; gap: 32px; margin-top: 22px; padding-top: 15px}
.metrics > div {display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px}
.metric-label {display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: #c8d3c5}
.metric-label .icon {width: 14px; height: 14px; align-self: center; transform: translateY(1px)}
.metric-value {font: 500 16px/1.35 var(--mono); color: #f4fae8; font-variant-numeric: tabular-nums}
.metric-value small {font-family: Inter, sans-serif; font-size: 12px}
.warning {margin-top: 13px; padding: 13px 16px; background: #fff1db; border: 1px solid #dfc098; border-radius: 8px; color: #764b22; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere}
.watch-section {margin-top: 14px}
.watchlist {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px}
.trader-card {min-width: 0; display: flex; flex-direction: column; padding: 12px 15px; background: #fffefa; border: 1px solid var(--line); border-radius: 10px}
.trader-head {display: flex; align-items: center; justify-content: space-between; gap: 6px}
.trader-head h2 {font-size: 16px; line-height: 1.3; overflow-wrap: anywhere}
.trader-link {display: inline-flex; align-items: center; gap: 5px; text-decoration: none; min-height: 35px}
.trader-link:hover {text-decoration: underline; text-underline-offset: 3px}
.trader-link .icon {width: 12px; height: 12px; color: var(--muted)}
.exchange, .position-empty, .more-positions, .snapshot-note, .position-numbers, .card-time {color: var(--muted); font-size: 12px; line-height: 1.6}
.exchange {font-size: 11px}
.position-line {padding: 4px 0}
.position-list {list-style: none; margin: 0; padding: 0}
.position-heading, .position-numbers {display: flex; gap: 2px 7px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere}
.position-heading strong {font: 600 13px var(--mono)}
.side {font-size: 12px; font-weight: 650}
.side.long {color: #28674c}
.side.short {color: #95452f}
.leverage {color: var(--muted); font: 600 12px var(--mono)}
.more-positions summary {cursor: pointer; padding-block: 5px}
.card-time {padding-top: 6px; margin-top: auto; font-size: 11px; color: #617267}
.last-operation {color: #617267; font-size: 11px; line-height: 1.6}
.trader-warning {margin-top: 5px; color: #855018; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere}
.snapshot-note {margin: 8px 2px 0}
.action-group {display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px}
.archive-tag {color: #78561e; background: #f5ebd4; border-radius: 3px; padding: 1px 4px; font-size: 10px; font-weight: 550; white-space: nowrap}
.ledger {margin-top: 31px}
.ledger-heading, .ledger-tools {display: flex; justify-content: space-between; align-items: center; gap: 12px}
.ledger-heading h2, .dialog-inner h2 {font-size: 24px; letter-spacing: -.035em; font-weight: 730; line-height: 1.35}
.timezone, .record-count {color: var(--muted); font-size: 12px}
.timezone span {font: 11px var(--mono); margin-left: 3px}
.ledger-tools {margin: 16px 0}
.feed-controls {display: flex; flex-wrap: wrap; align-items: center; gap: 7px}
#trader-filter {min-height: 42px; max-width: 100%; padding: 0 8px; border-radius: 8px; background: #fffefa; color: var(--ink); border: 1px solid #d6dace; font-size: 14px; font-weight: 600; cursor: pointer}
.filters {display: inline-flex; gap: 3px; border: 1px solid #d6dace; border-radius: 8px; background: #e9ece2; padding: 3px}
.filters button {font-weight: 620; font-size: 13px; background: transparent; border: 0; border-radius: 5px; padding: 0 17px; min-height: 34px}
.filters button[aria-pressed="true"] {background: #263e33; color: #f5f8eb}
.filters button:hover:not([aria-pressed="true"]) {background: #dde2d6}
.record-count {font-variant-numeric: tabular-nums}
.day {margin: 19px 0 0}
.day:first-child {margin-top: 0}
.date-line {display: flex; align-items: baseline; gap: 7px; margin: 0 0 8px; color: #4c5c51; font: 600 12px/1.5 var(--mono)}
.date-line::after {content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; margin-left: 4px}
.group-list {list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: #fffefa; overflow: hidden}
.entry {display: grid; grid-template-columns: minmax(190px,1.5fr) minmax(100px,1fr) minmax(100px,1fr) minmax(74px,.65fr); align-items: center; gap: 15px; padding: 14px 18px; border-top: 1px solid #e3e7dc; scroll-margin: 16px}
.entry:first-child {border-top: 0}
.entry.highlight {background: #f1f7d9; box-shadow: 3px 0 inset #638346}
.entry-main {display: flex; align-items: center; gap: 10px; min-width: 0}
.trade-mark {width: 37px; height: 37px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #5c635c; background: #edeee8}
.long .trade-mark {color: #246647; background: #e4efe1}
.short .trade-mark {color: #9e4a32; background: #f7e9dd}
.trade-mark .icon {width: 20px; height: 20px}
.short .trade-mark .icon {transform: rotate(90deg)}
.symbol {display: block; font: 650 15px/1.4 var(--mono); overflow-wrap: anywhere}
.trader-name {display: block; font-size: 12px; line-height: 1.5; color: #506057; overflow-wrap: anywhere}
.action-label {font-size: 12px; color: var(--muted); margin-top: 2px}
.entry.long .action-label {color: #28674c}
.entry.short .action-label {color: #95452f}
.value-cell {min-width: 0}
.value-cell small {display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px}
.value-cell strong, .value-cell time {display: block; font: 500 13px/1.32 var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere}
.time-cell {text-align: right}
.trade-times summary {cursor: pointer; list-style: none; border-radius: 3px}
.trade-times summary::-webkit-details-marker {display: none}
.trade-times summary small::after {content: "⌄"; margin-left: 4px}
.trade-times[open] summary small::after {content: "⌃"}
.observed {display: block; font: 11px/1.55 var(--mono); color: var(--muted); margin-top: 5px}
.empty {display: flex; flex-direction: column; gap: 9px; align-items: center; justify-content: center; min-height: 174px; padding: 22px; text-align: center; border: 1px solid var(--line); border-radius: 11px; background: #fffefa}
.empty .icon {width: 25px; height: 25px; color: #75816c}
.empty strong {font-size: 15px; font-weight: 650}
.empty p {max-width: 38em; color: var(--muted); font-size: 13px; line-height: 1.6}
dialog {width: min(400px, calc(100% - 32px)); max-height: min(80dvh, 660px); margin: auto; border: 1px solid #c9cec0; border-radius: 17px; padding: 0; background: #fcfcf7; color: var(--ink); box-shadow: 0 22px 68px #14271b38}
dialog::backdrop {background: #13221ccc}
.dialog-inner {padding: 24px}
.dialog-head {display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px}
.dialog-symbol {width: 41px; height: 41px}
.icon-button {display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eef0e7}
.icon-button .icon {width: 17px; height: 17px}
.device-status, .install-guide, .settings-message {color: var(--muted); line-height: 1.65; font-size: 14px}
.device-status {margin: 7px 0 18px}
.install-guide {display: flex; gap: 9px; padding: 12px; background: #edf1e3; border: 1px solid #dce2d2; border-radius: 8px}
.install-guide .icon {color: #415648; margin-top: 2px; width: 17px}
#pair-form label {display: block; font-size: 13px; font-weight: 650; margin-bottom: 7px}
#pair-code {width: 100%; background: #fff; border: 1px solid #bac4b7; border-radius: 7px; height: 45px; padding: 0 12px; color: var(--ink); font-size: 16px; margin-bottom: 11px}
.primary,.secondary {display: block; width: 100%; min-height: 44px; padding: 8px 12px; font-size: 14px; font-weight: 650; border-radius: 7px; border: 1px solid #2d4738; color: #f4f7ed; background: #254333}
.secondary {margin-top: 8px; background: transparent; color: #384b3f; border-color: #ccd4c7}
button:disabled {opacity: .55; cursor: wait}
.settings-message:not(:empty) {margin-top: 13px; overflow-wrap: anywhere}
.settings-message[data-type="error"] {color: #9b4233}
@media (max-width: 640px) {
  .bar-inner, .shell {width: calc(100% - 32px)}
  .bar-inner {height: 59px}
  .brand {font-size: 21px}
  .brand-icon {width: 32px; height: 32px}
  .brand-icon svg {width: 27px; height: 27px}
  .settings-button {border: none; background: transparent; padding: 0 3px 0 12px}
  .shell {padding-top: 17px}
  .hero {border-radius: 12px; padding: 17px 18px 19px}
  .hero-art {inset-inline-start: 27%}
  .orbit {width: 177px; right: -25px; top: 55%}
  .hero-top {margin: -3px -4px 0 0}
  .venue {font-size: 11px}
  h1 {margin: 10px 0}
  .metrics {margin-top: 20px; gap: 26px; padding-top: 13px}
  .metrics > div {flex-direction: column; gap: 4px}
  .metric-label {font-size: 11px}
  .metric-value {font-size: 15px}
  .ledger {margin-top: 24px}
  .ledger-heading h2 {font-size: 21px}
  .timezone {font-size: 11px}
  .ledger-tools {margin: 12px 0 15px}
  .trader-card {padding: 8px 10px}
  .trader-head {align-items: flex-start; flex-wrap: wrap; gap: 0 4px}
  .trader-head h2 {font-size: 15px}
  .trader-link {min-height: 33px}
  .exchange {align-self: center}
  .watchlist {gap: 7px}
  .record-count {white-space: nowrap}
  .filters button {padding-inline: 10px}
  .entry {grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 11px; padding: 12px 14px}
  .entry-main {grid-column:1; grid-row:1}
  .time-cell {grid-column:2; grid-row:1}
  .price-cell {grid-column:1; grid-row:2}
  .quantity-cell {grid-column:2; grid-row:2; text-align:right}
  .price-cell, .quantity-cell {display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px}
  .quantity-cell {justify-content: flex-end}
  .value-cell small {margin: 0}
  .time-cell small {margin-bottom: 3px}
  .trade-mark {width: 32px; height: 32px; border-radius: 7px}
  .entry-main {gap: 7px}
  .symbol {font-size: 14px}
  .action-label {font-size: 11px}
  dialog {width: min(100%, 450px); border-radius: 18px 18px 0 0; max-width: 100%; margin: auto auto 0; padding-bottom: env(safe-area-inset-bottom)}
}
@media (max-width: 355px) {
  .bar-inner, .shell {width: calc(100% - 22px)}
  .entry {padding-inline: 10px}
  .ledger-tools {align-items: flex-start; flex-direction: column; gap: 6px}
}
