    :root {
      --bg: #14212c;
      --panel: #1c2e3d;
      --line: #2f4658;
      --ink: #e9edf0;
      --mute: #8fa3b3;
      --gold: #e3b449;
      --up: #62c99c;
      --down: #e8695c;
      --rumor: #4da3ff;
      --event: #b88aff;
      --serif: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
      --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    }

    * {
      box-sizing: border-box
    }

    html,
    body {
      margin: 0
    }

    body {
      background: var(--bg);
      color: var(--ink);
      font: 15px/1.5 var(--sans);
      padding: 16px;
      min-height: 100vh
    }

    h1,
    h2 {
      font-family: var(--serif);
      margin: 0;
      font-weight: 700
    }

    .num {
      font-variant-numeric: tabular-nums
    }

    .wrap {
      max-width: 1180px;
      margin: 0 auto
    }

    header {
      display: flex;
      flex-wrap: wrap;
      gap: 16px 32px;
      align-items: flex-end;
      justify-content: space-between;
      margin-bottom: 14px
    }

    header h1 {
      font-size: 30px;
      color: var(--gold);
      letter-spacing: .5px
    }

    .stats {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 28px
    }

    .stat small {
      display: block;
      color: var(--mute);
      font-size: 12px
    }

    .stat b {
      font-size: 20px;
      font-family: var(--serif)
    }

    .up {
      color: var(--up)
    }

    .down {
      color: var(--down)
    }

    .cycle {
      display: flex;
      gap: 6px;
      margin-bottom: 16px;
      flex-wrap: wrap
    }

    .cycle div {
      flex: 1 1 150px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 12px;
      color: var(--mute);
      font-size: 13px
    }

    .cycle div b {
      display: block;
      color: inherit;
      font-size: 14px
    }

    .cycle div.on {
      border-color: var(--gold);
      color: var(--ink);
      background: #223648
    }

    .layout {
      display: grid;
      grid-template-columns: 1fr 330px;
      gap: 16px;
      align-items: start
    }

    @media(max-width:900px) {
      .layout {
        grid-template-columns: 1fr
      }
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px
    }

    .calendar-panel {
      margin-top: 16px
    }

    .panel>h2 {
      font-size: 18px;
      padding: 12px 16px;
      border-bottom: 1px solid var(--line)
    }

    .row {
      display: grid;
      grid-template-columns: minmax(120px, 1.3fr) 100px 70px 90px minmax(210px, 1.6fr);
      gap: 10px;
      align-items: center;
      padding: 10px 16px;
      border-bottom: 1px solid var(--line)
    }

    .row:last-child {
      border-bottom: 0
    }

    .row.head {
      color: var(--mute);
      font-size: 12px;
      padding-top: 8px;
      padding-bottom: 8px
    }

    .name b {
      display: block
    }

    .name small {
      color: var(--mute)
    }

    .tag {
      font-size: 11px;
      border: 1px solid var(--line);
      border-radius: 3px;
      padding: 0 5px;
      margin-left: 6px;
      color: var(--mute)
    }

    .price b {
      font-size: 17px
    }

    .price small {
      display: block;
      font-size: 12px
    }

    .own small {
      display: block;
      color: var(--mute);
      font-size: 12px
    }

    .btns {
      display: flex;
      flex-wrap: wrap;
      gap: 4px
    }

    button {
      font: inherit;
      font-size: 13px;
      cursor: pointer;
      border-radius: 5px;
      border: 1px solid var(--line);
      background: #26394a;
      color: var(--ink);
      padding: 4px 9px
    }

    button:hover {
      border-color: var(--mute)
    }

    button:focus-visible {
      outline: 2px solid var(--gold);
      outline-offset: 2px
    }

    button.buy {
      border-color: #3d7a62
    }

    button.sell {
      border-color: #8a4a44
    }

    button.primary {
      background: var(--gold);
      color: #1a1a12;
      border-color: var(--gold);
      font-weight: 700;
      font-size: 16px;
      padding: 10px 22px
    }

    button:disabled {
      opacity: .4;
      cursor: not-allowed
    }

    @media(max-width:700px) {
      .row {
        grid-template-columns: 1fr 1fr
      }

      .row.head {
        display: none
      }

      .btns {
        grid-column: 1/-1
      }
    }

    .news {
      max-height: 520px;
      overflow: auto
    }

    .item {
      padding: 10px 16px;
      border-bottom: 1px solid var(--line);
      font-size: 14px
    }

    .item:last-child {
      border-bottom: 0
    }

    .item small {
      display: block;
      color: var(--mute);
      font-size: 12px
    }

    .item.rumor {
      border-left: 3px solid var(--rumor)
    }

    .item.event {
      border-left: 3px solid var(--event)
    }

    .item.info {
      border-left: 3px solid var(--line);
      color: var(--mute)
    }

    .item.new {
      background: #223648
    }

    .footer {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      margin-top: 16px
    }

    .footer p {
      margin: 0;
      color: var(--mute);
      font-size: 13px;
      max-width: 60ch
    }

    #toast {
      position: fixed;
      left: 50%;
      bottom: 24px;
      transform: translateX(-50%);
      background: #0e171f;
      border: 1px solid var(--gold);
      padding: 8px 16px;
      border-radius: 6px;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s
    }

    #toast.show {
      opacity: 1
    }

    dialog {
      background: var(--panel);
      color: var(--ink);
      border: 1px solid var(--gold);
      border-radius: 10px;
      padding: 0;
      max-width: 520px;
      width: calc(100% - 32px)
    }

    dialog::backdrop {
      background: rgba(5, 10, 15, .7)
    }

    .dlg {
      padding: 20px 22px
    }

    .dlg h2 {
      font-size: 22px;
      color: var(--gold);
      margin-bottom: 10px
    }

    .dlg table {
      width: 100%;
      border-collapse: collapse;
      margin: 10px 0
    }

    .dlg td {
      padding: 4px 0;
      border-bottom: 1px solid var(--line)
    }

    .dlg td:last-child {
      text-align: right
    }

    .dlg h3 {
      font-size: 13px;
      color: var(--mute);
      margin: 14px 0 4px;
      font-weight: 600
    }

    .dlg ul {
      margin: 0;
      padding-left: 18px;
      font-size: 14px
    }

    .dlg .actions {
      text-align: right;
      margin-top: 16px
    }

    .badge {
      font-size: 11px;
      border-radius: 3px;
      padding: 0 6px;
      margin-right: 6px;
      font-weight: 700;
      color: #14212c
    }

    .badge.rumor {
      background: var(--rumor)
    }

    .badge.event {
      background: var(--event)
    }

    .spark {
      background: none;
      border: 1px solid transparent;
      padding: 2px 4px;
      margin-top: 2px;
      display: block;
      line-height: 0
    }

    .spark:hover {
      border-color: var(--mute)
    }

    .qty {
      display: flex;
      gap: 4px;
      align-items: center;
      flex-wrap: wrap
    }

    .qty input {
      width: 72px;
      font: inherit;
      font-size: 14px;
      background: #0f1a23;
      color: var(--ink);
      border: 1px solid var(--line);
      border-radius: 5px;
      padding: 4px 6px
    }

    .qty input:focus-visible {
      outline: 2px solid var(--gold);
      outline-offset: 1px
    }

    .cal {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 4px;
      padding: 12px 16px
    }

    .cal-day {
      min-height: 62px;
      border: 1px solid var(--line);
      border-radius: 5px;
      padding: 3px 5px;
      font-size: 11px;
      min-width: 0
    }

    .cal-day .d {
      display: block;
      color: var(--mute);
      font-size: 12px
    }

    .cal-day.today {
      border-color: var(--gold)
    }

    .cal-day.future {
      opacity: .5
    }

    .chip {
      display: block;
      border-radius: 3px;
      padding: 0 4px;
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      border: 1px solid currentColor
    }

    .cal-list {
      padding: 0 16px 12px;
      font-size: 14px;
      margin: 0;
      list-style: none
    }

    .cal-list li {
      padding: 4px 0;
      border-top: 1px solid var(--line)
    }

    .hist {
      max-height: 220px;
      overflow: auto
    }

    .hist td {
      text-align: right
    }

    .hist td:first-child {
      text-align: left
    }

    @media(max-width:700px) {
      .cal {
        grid-template-columns: repeat(5, 1fr)
      }
    }

    @media(prefers-reduced-motion:reduce) {
      #toast {
        transition: none
      }
    }
