:root {
  --bg1: #efefef;
  --bg2: #e8e8ea;
  --card: #f4f4f6;
  --line: #d2d2d8;
  --text: #1f2430;
  --muted: #777a84;
  --accent-blue: #8aaee8;
  --accent-yellow: #e8c05d;
  --accent-green: #9bc7ab;
  --accent-red: #c88d8d;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--bg1);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  min-height: 100%;
  overscroll-behavior-y: contain;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.app { max-width: 1360px; margin: 0 auto; padding: 12px; }
.hidden { display: none !important; }
button,
[role="button"],
.place-dock-item,
.opportunity-card {
  touch-action: manipulation;
}
button {
  user-select: none;
  -webkit-user-select: none;
}
input,
textarea,
select {
  touch-action: manipulation;
}
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 3px 10px rgba(28, 31, 42, 0.06);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.save-banner {
  margin: 10px 2px 0;
  padding: 10px 12px;
  border: 1px solid #8fc7a6;
  border-radius: 10px;
  background: #edf9f1;
  color: #1f6b3c;
  font-weight: 600;
}
.save-banner.error {
  border-color: #d39a9a;
  background: #fff0f0;
  color: #8b2e2e;
}
.save-banner.hidden {
  display: none;
}
.round-progress {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 9px 12px;
}
.round-progress.combo-pop {
  animation: comboPop 520ms ease-out;
}
.round-progress-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
  color: #4f5a70;
  font-size: 12px;
}
.round-progress-meta strong {
  color: #202838;
  font-size: 13px;
}
#roundGoalText {
  color: #243047;
  font-weight: 800;
}
#roundBountyText {
  color: #7b5617;
  font-weight: 800;
}
#roundStreakText {
  color: #2c6b44;
  font-weight: 800;
}
#roundGoalText,
#roundBountyText,
#roundStreakText,
#roundGoalProgressTrack {
  display: none;
}
.round-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce1ec;
}
.round-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7aa2e3, #9bc7ab 55%, #e8c05d);
  transition: width 260ms ease;
}
.goal-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee3c8;
}
.goal-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e1b64c, #84bd76);
  transition: width 260ms ease;
}
@keyframes comboPop {
  0% {
    border-color: #d2d2d8;
    box-shadow: 0 0 0 rgba(155, 199, 171, 0);
    transform: translateY(0);
  }
  35% {
    border-color: #7fb492;
    box-shadow: 0 0 0 5px rgba(155, 199, 171, 0.28);
    transform: translateY(-1px);
  }
  100% {
    border-color: #d2d2d8;
    box-shadow: 0 0 0 rgba(155, 199, 171, 0);
    transform: translateY(0);
  }
}
.opportunity-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
}
.opportunity-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d5dce9;
  border-radius: 8px;
  background: #f8faff;
}
.opportunity-card span {
  color: #667084;
  font-size: 11px;
}
.opportunity-card strong {
  overflow: hidden;
  color: #222b3d;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opportunity-card small {
  min-height: 15px;
  overflow: hidden;
  color: #63708a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opportunity-card button {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}
.opportunity-card.opportunity-good {
  border-color: #96c7a7;
  background: #eef8f1;
}
.opportunity-card.opportunity-good button {
  border-color: #82b998;
  background: #dff2e6;
}
.opportunity-primary.opportunity-good {
  border-color: #8eaadd;
  background: #edf4ff;
}
.opportunity-card.opportunity-wait button:disabled {
  opacity: 0.55;
}
.thumb-action-dock {
  display: none;
}
h1, h2, p { margin: 0; }
h1 {
  font-size: 28px;
  letter-spacing: 0.04em;
  font-weight: 700;
}
h2 {
  font-size: 16px;
  margin-bottom: 6px;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.score {
  font-weight: 700;
  font-size: 20px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.mobile-top-cash {
  display: none;
}
.mobile-menu-btn,
.mobile-menu-card {
  display: none;
}
.mobile-menu-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 178px;
  padding: 8px;
  border: 1px solid #d3d9e8;
  border-radius: 10px;
  background: #f9fbff;
  box-shadow: 0 8px 20px rgba(25, 31, 44, 0.14);
  z-index: 50;
}
.mobile-menu-card button {
  width: 100%;
  text-align: left;
  margin-top: 6px;
  padding: 6px 8px;
}
.mobile-menu-online {
  font-size: 12px;
  color: #5f6676;
  padding: 2px 2px 4px;
}
.mobile-menu-version {
  overflow-wrap: anywhere;
  padding: 0 2px 6px;
  color: #7b8291;
  font-size: 10px;
  line-height: 1.3;
}
body.hide-auth-ui #accountBtnTop,
body.hide-auth-ui #accountModal,
body.hide-auth-ui .start-auth-actions {
  display: none !important;
}
.online-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid #d4d8e2;
  border-radius: 999px;
  background: #f7f9fc;
  color: #5f6676;
  font-size: 12px;
  white-space: nowrap;
}
.online-avatars {
  display: flex;
  align-items: center;
  padding-left: 4px;
}
.online-avatar {
  width: 24px;
  height: 24px;
  margin-left: -4px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #f7f9fc;
  border-radius: 999px;
  background: #dfe8f7;
  color: #354052;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(28, 31, 42, 0.12);
}
.online-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.icon-btn {
  min-width: 56px;
  padding: 6px 10px;
}
.avatar-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
}
.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #84a8e2, #5f7fb6);
}
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.topbar #dayText {
  margin-top: 4px;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.top-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.top-round-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(30, 35, 48, 0.16);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
}
.top-news-ticker {
  max-width: 100%;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.headline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-card {
  padding: 14px 16px;
}
.kicker {
  color: #8a8d96;
  font-size: 13px;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.stat-card h3 {
  margin: 8px 0 4px;
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: #121620;
}
.cash-pulse {
  animation: cashPulse 620ms ease-out;
}
@keyframes cashPulse {
  0% { transform: scale(1) translateX(0); }
  18% { transform: scale(1.08) translateX(-2px); }
  36% { transform: scale(1.11) translateX(2px); }
  52% { transform: scale(1.06) translateX(-1px); }
  70% { transform: scale(1.03) translateX(1px); }
  100% { transform: scale(1) translateX(0); }
}
.sub {
  font-size: 13px;
  color: var(--muted);
}

.trade-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(360px, 1.25fr) minmax(220px, 0.7fr);
  grid-template-areas: "market inv ops";
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}
#marketPanel { grid-area: market; }
#invPanel { grid-area: inv; }
#opsPanel { grid-area: ops; }
.bottom-grid {
  display: grid;
  grid-template-columns: 1.57fr 2.30fr;
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}

.panel { padding: 10px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.loc-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #cad2e5;
  background: #eff3fb;
  color: #4b566d;
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.market-loc-active .loc-chip {
  border-color: #b99b4f;
  background: #f4ebd5;
  color: #5e4b20;
}
.middle { display: grid; gap: 8px; align-content: start; }
.middle hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
.panel-note {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.error-text {
  color: #a13a2f !important;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.table-scroll {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #d8dde8;
  border-radius: 10px;
  background: #f8f9fd;
}
.table-scroll table {
  border-collapse: separate;
  border-spacing: 0;
}
th, td {
  border-bottom: 1px solid #dedee4;
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th {
  color: var(--muted);
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  letter-spacing: 0.06em;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef1f7;
}
#marketTable th:nth-child(2), #marketTable td:nth-child(2) { text-align: right; width: 34%; }
#invTable th:nth-child(2), #invTable td:nth-child(2),
#invTable th:nth-child(3), #invTable td:nth-child(3) { text-align: right; width: 22%; }
tr.selected { background: rgba(138, 174, 232, 0.28); }
tr.owned { background: rgba(155, 199, 171, 0.25); }
tr.deal-buy-row,
tr.deal-sell-row {
  outline: 2px solid rgba(139, 187, 160, 0.55);
  outline-offset: -2px;
  background: #edf8f1;
}
tr:hover { background: rgba(138, 174, 232, 0.16); cursor: pointer; }
td .deal-badge,
td .price-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 3px;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid #b8cce4;
  background: #eef4ff;
  color: #40506b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}
td .deal-badge {
  border-color: #91bd9f;
  background: #def2e5;
  color: #24593b;
}
td .price-tag {
  display: flex;
  margin-left: auto;
}
.market-refresh #marketTable tbody tr {
  transform-origin: top;
  animation: marketRowRefresh 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--row-index, 0) * 28ms);
}
@keyframes marketRowRefresh {
  0% { transform: perspective(380px) rotateX(-68deg) scaleY(0.9); opacity: 0.2; filter: blur(1px); }
  60% { transform: perspective(380px) rotateX(14deg) scaleY(1.02); opacity: 0.95; filter: blur(0); }
  100% { transform: perspective(380px) rotateX(0deg) scaleY(1); opacity: 1; }
}

input {
  width: 100%;
  margin-top: 4px;
  background: #fafafc;
  color: var(--text);
  border: 1px solid #d3d6df;
  border-radius: 8px;
  padding: 6px 8px;
}
button {
  border: 1px solid #c9ced9;
  background: #eef1f8;
  color: #202534;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}
button:hover { background: #e3e8f4; }
button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  background: #eceff6;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.stats div {
  padding: 6px 8px;
  border-radius: 8px;
  background: #ececf0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stats span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stats strong {
  font-size: 18px;
  line-height: 1.1;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
}
#debtStatCard {
  cursor: pointer;
}
.debt-guide-ready {
  border-color: #d6a248 !important;
  background: linear-gradient(180deg, #fff7e8, #f8efd8) !important;
}
.ops {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ops-group {
  border: 1px solid #d9dbe3;
  border-radius: 10px;
  background: #f0f1f5;
  padding: 8px;
}

.ops-group h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f7380;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
}

.ops-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) repeat(2, minmax(84px, 1fr));
  gap: 6px;
  align-items: end;
}

.ops-row label {
  font-size: 12px;
  color: #606574;
}

.ops-row button {
  min-height: 34px;
}

.repay-row {
  grid-template-columns: minmax(120px, 1.4fr) minmax(160px, 1fr);
}

.map-frame {
  position: relative;
  border: 1px solid #d5d8e1;
  border-radius: 12px;
  background: radial-gradient(circle at 20% 20%, #fbfcff, #eef1f7);
  min-height: 360px;
  padding: 10px;
}

.map-grid {
  display: grid;
  gap: 8px;
}

.city-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}
.district-block {
  border: 1px solid #d5dae5;
  border-radius: 10px;
  padding: 8px;
  background: #f7f9fc;
}
.district-title {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #555d6f;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
}
.district-items {
  display: grid;
  gap: 6px;
}

.map-btn {
  font-size: 12px;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 10px;
  background: #f9fbff;
  border: 1px solid #cfd5e3;
  box-shadow: 0 2px 6px rgba(38, 49, 78, 0.08);
}
.map-btn.active {
  background: rgba(232, 192, 93, 0.5);
  border-color: rgba(188, 149, 52, 0.9);
}
.district-xihu { background: #e9f5ea; border-color: #8bbc90; }
.district-shangcheng { background: #fff2e5; border-color: #e7ac67; }
.district-gongshu { background: #e8f2ff; border-color: #80a9de; }
.district-binjiang { background: #f1ecff; border-color: #9d86da; }
.district-yuhang { background: #e8f8f5; border-color: #6eb7a5; }
.district-xiaoshan { background: #fff0f4; border-color: #df8ca9; }
.district-qiantang { background: #fef8e8; border-color: #cfb35d; }

.logs {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 4px;
  font-size: 13px;
  padding-right: 4px;
}
.mobile-tabs {
  display: none;
}
.mobile-status-strip {
  display: none;
}

body.desktop-ui {
  overflow-x: hidden;
}
body.desktop-ui .app {
  max-width: 1400px;
  padding: 10px;
}
body.desktop-ui .topbar {
  margin-bottom: 8px;
  padding: 12px 14px;
}
body.desktop-ui .headline-grid {
  margin-bottom: 8px;
  gap: 8px;
}
body.desktop-ui .stat-card {
  padding: 12px 14px;
}
body.desktop-ui .stat-card h3 {
  font-size: clamp(42px, 2.9vw, 54px);
}
body.desktop-ui .trade-grid,
body.desktop-ui .bottom-grid {
  margin-bottom: 8px;
  gap: 8px;
}
body.desktop-ui .trade-grid {
  grid-template-columns: minmax(420px, 1.24fr) minmax(420px, 1.22fr) minmax(240px, 0.62fr);
}
body.desktop-ui .bottom-grid {
  grid-template-columns: minmax(460px, 1.18fr) minmax(520px, 1.32fr);
}
body.desktop-ui .panel {
  padding: 8px;
}
body.desktop-ui #tradeSection .panel,
body.desktop-ui #bottomSection .panel {
  min-height: 0;
}
body.desktop-ui .table-scroll {
  max-height: 300px;
}
body.desktop-ui .map-frame {
  min-height: 430px;
  max-height: 430px;
  overflow: auto;
}
body.desktop-ui .city-grid {
  grid-template-columns: repeat(4, minmax(122px, 1fr));
  gap: 8px;
}
body.desktop-ui .district-items {
  gap: 5px;
}
body.desktop-ui .map-btn {
  min-height: 32px;
}
body.desktop-ui .stats strong {
  font-size: 16px;
}
body.desktop-ui .ops {
  gap: 8px;
}
body.desktop-ui .ops-group {
  padding: 7px;
}
body.desktop-ui .ops-row {
  grid-template-columns: minmax(118px, 1.2fr) repeat(2, minmax(88px, 1fr));
}
body.desktop-ui .repay-row {
  grid-template-columns: minmax(118px, 1.2fr) minmax(160px, 1fr);
}
body.desktop-ui #logsSection {
  padding: 8px;
}
body.desktop-ui .logs {
  max-height: 150px;
}

body.mobile-ui .app {
  padding: 5px 5px calc(10px + env(safe-area-inset-bottom));
}
body.mobile-ui .topbar {
  padding: 6px 8px;
  margin-bottom: 5px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
body.mobile-ui .topbar-brand {
  min-width: 0;
}
body.mobile-ui h1 {
  display: none;
}
body.mobile-ui .mobile-top-cash {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: #586173;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.mobile-ui #dayText {
  margin-top: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.mobile-ui .top-actions {
  width: auto;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}
body.mobile-ui .online-status {
  display: none;
}
body.mobile-ui .score {
  display: none;
}
body.mobile-ui .icon-btn,
body.mobile-ui #newGameBtnTop {
  min-width: 42px;
  min-height: 26px;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.1;
}
body.mobile-ui .avatar-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
}
body.mobile-ui #newGameBtnTop,
body.mobile-ui #rankBtnTop,
body.mobile-ui #uiModeToggleBtn {
  display: none;
}
body.mobile-ui .mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 26px;
  padding: 2px 8px;
  font-size: 15px;
  line-height: 1;
}
body.mobile-ui .mobile-menu-card {
  display: block;
}
body.mobile-ui .account-avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
}
body.mobile-ui .headline-grid {
  gap: 6px;
  margin-bottom: 6px;
  grid-template-columns: 1fr 1fr;
}
body.mobile-ui .stat-card {
  padding: 7px 9px;
}
body.mobile-ui .stat-card h3 {
  font-size: 22px;
  margin: 5px 0 2px;
  line-height: 1.05;
}
body.mobile-ui .kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
}
body.mobile-ui .sub {
  font-size: 10px;
}
body.mobile-ui .mobile-tabs,
body.mobile-ui .round-progress {
  display: none !important;
}
body.mobile-ui .opportunity-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 6px;
  padding: 6px;
  overflow: hidden;
}
body.mobile-ui .opportunity-card {
  padding: 7px;
}
body.mobile-ui .opportunity-primary {
  grid-template-columns: minmax(0, 1fr) minmax(118px, 38vw);
  align-items: center;
  order: -1;
  grid-column: 1 / -1;
}
body.mobile-ui .opportunity-primary span,
body.mobile-ui .opportunity-primary strong,
body.mobile-ui .opportunity-primary small {
  grid-column: 1;
}
body.mobile-ui .opportunity-primary button {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: stretch;
}
body.mobile-ui .opportunity-card strong {
  font-size: 13px;
}
body.mobile-ui .opportunity-card small,
body.mobile-ui .opportunity-card span {
  font-size: 10px;
}
body.mobile-ui .opportunity-card button {
  min-height: 44px;
  padding: 7px 8px;
  font-size: 12px;
}
body.mobile-ui .thumb-action-dock {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 38vw);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #c8d3e6;
  border-radius: 16px;
  background: rgba(244, 246, 251, 0.96);
  box-shadow: 0 14px 34px rgba(27, 32, 44, 0.22);
  backdrop-filter: blur(10px);
}
body.mobile-ui .thumb-action-dock.opportunity-good {
  border-color: #8dbba1;
  background: rgba(238, 248, 241, 0.97);
}
body.mobile-ui .thumb-action-dock.opportunity-wait {
  border-color: #c8d3e6;
}
body.mobile-ui .thumb-action-dock.goal-hot {
  border-color: #e1b64c;
  background: linear-gradient(135deg, rgba(255, 248, 231, 0.98), rgba(236, 249, 239, 0.98));
  box-shadow: 0 14px 36px rgba(118, 82, 18, 0.24);
}
body.mobile-ui .thumb-action-dock.goal-hot #thumbActionBtn {
  border-color: #d39b2f;
  background: #ffe7a6;
  color: #2c2108;
  box-shadow: 0 2px 0 rgba(118, 82, 18, 0.18);
}
body.mobile-ui .thumb-action-dock.sprint-hot {
  border-color: #e58a53;
  background: linear-gradient(135deg, rgba(255, 244, 232, 0.98), rgba(239, 248, 237, 0.98));
  box-shadow: 0 14px 36px rgba(137, 69, 22, 0.22);
}
body.mobile-ui .thumb-action-dock.sprint-hot #thumbActionBtn {
  border-color: #d9763a;
  background: #ffd8ae;
  color: #2d1709;
}
body.mobile-ui .thumb-action-dock.thumb-pop {
  animation: thumbDockPop 360ms ease-out;
}
body.mobile-ui .thumb-action-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
body.mobile-ui .thumb-action-copy span {
  color: #6d7483;
  font-size: 10px;
  font-weight: 700;
}
body.mobile-ui .thumb-action-copy strong {
  overflow: hidden;
  color: #202838;
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mobile-ui .thumb-action-copy small {
  overflow: hidden;
  color: #68738a;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mobile-ui .thumb-action-copy em {
  overflow: hidden;
  color: #3f664b;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mobile-ui .thumb-action-dock.opportunity-wait .thumb-action-copy em {
  color: #68738a;
}
body.mobile-ui .thumb-action-dock.goal-hot .thumb-action-copy em {
  color: #875f16;
}
body.mobile-ui .thumb-action-dock.sprint-hot .thumb-action-copy em {
  color: #914616;
}
body.mobile-ui #thumbActionBtn {
  min-height: 56px;
  border-color: #7fb492;
  border-radius: 12px;
  background: #dff2e6;
  color: #13231a;
  font-size: 15px;
  font-weight: 800;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 2px 0 rgba(34, 78, 50, 0.14);
}
body.mobile-ui #thumbActionBtn:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: none;
}
body.mobile-ui .thumb-action-dock.action-locked #thumbActionBtn {
  filter: brightness(0.97);
  transform: translateY(1px) scale(0.99);
}
body.mobile-ui #thumbActionBtn:disabled {
  border-color: #cad1dd;
  background: #e8ecf4;
  color: #858d9c;
  box-shadow: none;
}
@keyframes thumbDockPop {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 14px 34px rgba(27, 32, 44, 0.22);
  }
  45% {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 40px rgba(47, 96, 66, 0.24);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 14px 34px rgba(27, 32, 44, 0.22);
  }
}
body.mobile-ui .mobile-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  align-items: stretch;
  padding: 4px;
  margin-bottom: 5px;
}
body.mobile-ui .mini-stat {
  background: #eceff6;
  border: 1px solid #d6dbe8;
  border-radius: 7px;
  padding: 3px 5px;
  display: grid;
  gap: 2px;
  min-height: 34px;
  min-width: 0;
}
body.mobile-ui .mini-stat span {
  font-size: 9px;
  color: #626978;
  letter-spacing: 0.03em;
}
body.mobile-ui .mini-stat strong {
  font-size: 11px;
  line-height: 1.15;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.mobile-ui .mini-stat-btn {
  appearance: none;
  width: 100%;
  min-height: 34px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #d6dbe8;
  background: #eceff6;
  padding: 4px 6px;
}
body.mobile-ui .mini-stat-btn:hover {
  background: #e6ebf6;
}
.debt-guide-glow {
  border-color: #e2a33f !important;
  box-shadow: 0 0 0 0 rgba(226, 163, 63, 0.5);
  animation: debtGlowPulse 1.2s ease-in-out infinite;
}
@keyframes debtGlowPulse {
  0% { box-shadow: 0 0 0 0 rgba(226, 163, 63, 0.48); }
  70% { box-shadow: 0 0 0 10px rgba(226, 163, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 163, 63, 0); }
}
body.mobile-ui .mini-expand-btn,
body.mobile-ui .mini-travel-btn {
  display: none;
}
body.mobile-ui .mini-expand-btn {
  min-height: 44px;
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
  border-color: #88a6d8;
  background: #dce8ff;
}
body.mobile-ui .mini-travel-btn {
  min-height: 44px;
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
  border-color: #8bbba0;
  background: #e2f3e7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.mobile-ui .mobile-tab {
  min-height: 44px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 6px;
}
body.mobile-ui .mobile-tab.active {
  background: #dce8ff;
  border-color: #8eaadd;
}
body.mobile-ui .trade-grid,
body.mobile-ui .bottom-grid {
  margin-bottom: 6px;
  gap: 6px;
  grid-template-columns: 1fr;
}
body.mobile-ui .headline-grid {
  display: none;
}
body.mobile-ui .panel {
  padding: 7px;
}
body.mobile-ui h2 {
  font-size: 12px;
  margin-bottom: 4px;
}
body.mobile-ui #tradeSection .panel-head {
  align-items: center;
}
body.mobile-ui #tradeSection .panel-head button {
  min-height: 24px;
  min-width: 66px;
  font-size: 10px;
  padding: 2px 6px;
}
body.mobile-ui .panel-note {
  font-size: 10px;
  margin: 1px 0 5px;
}
body.mobile-ui #marketPanel .panel-note {
  display: none;
}
body.mobile-ui .table-scroll {
  max-height: 250px;
}
body.mobile-ui #marketTable th:nth-child(1),
body.mobile-ui #marketTable td:nth-child(1) {
  width: 60%;
}
body.mobile-ui #invTable th:nth-child(1),
body.mobile-ui #invTable td:nth-child(1) {
  width: 48%;
}
body.mobile-ui .middle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
body.mobile-ui .quick-trade-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
body.mobile-ui .middle hr {
  display: none;
}
body.mobile-ui #tradeHint {
  grid-column: 1 / -1;
  margin: 0;
}
body.mobile-ui .middle label,
body.mobile-ui .ops-row label {
  font-size: 10px;
}
body.mobile-ui .middle button,
body.mobile-ui .ops-row button,
body.mobile-ui .repay-row button {
  min-height: 30px;
  font-size: 12px;
  padding: 4px 6px;
}
body.mobile-ui #buyMaxBtn,
body.mobile-ui #sellMaxBtn {
  background: #e9f0ff;
  border-color: #a5b9e2;
  font-weight: 600;
}
body.mobile-ui #buyMaxBtn:disabled,
body.mobile-ui #sellMaxBtn:disabled,
body.mobile-ui .mini-travel-btn:disabled {
  opacity: 0.55;
}
body.mobile-ui .stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
body.mobile-ui .stats strong {
  font-size: 13px;
}
body.mobile-ui .stats span {
  font-size: 10px;
}
body.mobile-ui .ops {
  gap: 5px;
}
body.mobile-ui .ops-group {
  padding: 6px;
}
body.mobile-ui .ops-row,
body.mobile-ui .repay-row {
  grid-template-columns: 1fr;
  gap: 4px;
}
body.mobile-ui input {
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
}
body.mobile-ui .city-grid {
  grid-template-columns: repeat(2, minmax(128px, 1fr));
  gap: 5px;
}
body.mobile-ui .map-frame {
  min-height: 300px;
  max-height: 52vh;
  overflow: auto;
  padding: 6px;
}
body.mobile-ui .district-block {
  padding: 6px;
  border-radius: 8px;
}
body.mobile-ui .district-title {
  margin-bottom: 4px;
  font-size: 10px;
}
body.mobile-ui .map-btn {
  min-height: 30px;
  font-size: 12px;
  padding: 3px 6px;
}
body.mobile-ui #logsSection {
  margin-bottom: 8px;
}
body.mobile-ui .logs {
  max-height: 130px;
  font-size: 11px;
}
body.mobile-ui .logs div {
  padding: 5px 6px;
}
body.mobile-ui th,
body.mobile-ui td {
  padding: 5px 6px;
  font-size: 11px;
}
body.mobile-ui th {
  font-size: 10px;
}
body.mobile-ui .account-actions,
body.mobile-ui #userPanel .account-actions,
body.mobile-ui .leaderboard-list li {
  grid-template-columns: 1fr;
}
body.mobile-ui .leaderboard-list small {
  grid-column: auto;
}

body.mobile-ui.mobile-view-trade #bottomSection,
body.mobile-ui.mobile-view-trade #logsSection {
  display: none;
}
body.mobile-ui.mobile-view-trade #tradeSection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "market inv"
    "market ops";
  gap: 6px;
}
body.mobile-ui.mobile-view-trade #marketPanel {
  grid-area: market;
}
body.mobile-ui.mobile-view-trade #invPanel {
  grid-area: inv;
}
body.mobile-ui.mobile-view-trade #opsPanel {
  grid-area: ops;
}
body.mobile-ui.mobile-view-trade #marketPanel .table-scroll {
  max-height: 58vh;
}
body.mobile-ui.mobile-view-trade #invPanel .table-scroll {
  max-height: 23vh;
}
body.mobile-ui.mobile-view-trade #opsPanel {
  align-self: start;
}
body.mobile-ui.mobile-view-trade #opsPanel .quick-trade-row {
  grid-template-columns: 1fr;
}
@media (max-width: 420px) {
  body.mobile-ui .mini-stat strong,
  body.mobile-ui .mini-expand-btn {
    font-size: 11px;
  }
  body.mobile-ui.mobile-view-trade #tradeSection {
    grid-template-columns: 1fr;
    grid-template-areas:
      "market"
      "inv"
      "ops";
  }
  body.mobile-ui.mobile-view-trade #marketPanel .table-scroll {
    max-height: 38vh;
  }
  body.mobile-ui.mobile-view-trade #invPanel .table-scroll {
    max-height: 18vh;
  }
}
body.mobile-ui.mobile-view-status #tradeSection,
body.mobile-ui.mobile-view-status #mapPanel {
  display: none;
}
body.mobile-ui.mobile-view-status #logsSection {
  display: block;
}
body.mobile-ui #startModal .summary-card {
  width: min(360px, calc(100vw - 18px));
  max-height: calc(100dvh - 22px);
  overflow: hidden;
  padding: 10px;
}
body.mobile-ui .round-progress {
  margin: 0 0 6px;
  padding: 6px 8px;
}
body.mobile-ui .round-progress-meta {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  font-size: 10px;
}
body.mobile-ui .round-progress-meta strong {
  font-size: 11px;
}
body.mobile-ui #roundPaceText {
  grid-column: 1 / 3;
}
body.mobile-ui #roundGoalText,
body.mobile-ui #roundBountyText,
body.mobile-ui #roundStreakText,
body.mobile-ui #roundGoalProgressTrack {
  display: block;
}
body.mobile-ui #roundGoalText {
  grid-column: 1 / 3;
  overflow: hidden;
  color: #243047;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mobile-ui #roundBountyText {
  grid-column: 1 / 3;
  overflow: hidden;
  color: #7b5617;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mobile-ui #roundStreakText {
  grid-column: 1 / 3;
  overflow: hidden;
  color: #2c6b44;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mobile-ui .round-progress-track {
  height: 5px;
}
body.mobile-ui .goal-progress-track {
  grid-column: 1 / 3;
  height: 4px;
}
body.mobile-ui #startModal .summary-card h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
}
body.mobile-ui #startModal .modal-body.start-brief {
  margin-bottom: 8px;
  line-height: 1.35;
  white-space: normal;
}
body.mobile-ui #startModal .modal-body.start-brief p {
  margin-bottom: 4px;
  font-size: 12px;
}
body.mobile-ui #startModal .start-goal-card {
  margin-bottom: 7px;
  padding: 8px;
}
body.mobile-ui #startModal .start-goal-card > strong {
  font-size: 15px;
}
body.mobile-ui #startModal .start-goal-card > small {
  font-size: 11px;
}
body.mobile-ui #startModal .start-goal-grid {
  gap: 5px;
}
body.mobile-ui #startModal .start-goal-stat {
  padding: 5px 6px;
}
body.mobile-ui #startModal .modal-actions.start-auth-actions {
  margin-bottom: 6px;
  gap: 6px;
}
body.mobile-ui #startModal .modal-actions.start-auth-actions button {
  min-height: 30px;
  font-size: 11px;
  padding: 4px 6px;
}
body.mobile-ui #startConfirmBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border-color: #7fb492;
  border-radius: 14px;
  background: #dff2e6;
  color: #13231a;
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  padding: 8px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(34, 78, 50, 0.14);
}
body.mobile-ui #startConfirmBtn:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: none;
}
body.mobile-ui #endModal .modal-actions {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px -8px -8px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #d8deeb;
  background: linear-gradient(180deg, rgba(247, 247, 250, 0.82), #f7f7fa 28%);
}
body.mobile-ui #endModal .modal-actions button {
  min-height: 44px;
}
body.mobile-ui #endModal #endReplayBtn {
  grid-column: 1 / -1;
  min-height: 54px;
  border-radius: 14px;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(34, 78, 50, 0.14);
}
body.mobile-ui #endModal #endSaveBtn,
body.mobile-ui #endModal #endShareBtn,
body.mobile-ui #endModal #endCopyBtn,
body.mobile-ui #endModal #endSkipBtn {
  min-height: 44px;
  border-color: #d4dbe9;
  background: #f1f4fb;
  color: #526078;
  font-size: 12px;
  font-weight: 700;
}
body.mobile-ui #endModal .summary-card {
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 18px));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  padding: 10px 10px 8px;
}
body.mobile-ui #endModal .summary-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}
body.mobile-ui #endModal #endSummaryBody {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
  overscroll-behavior: contain;
  padding-bottom: 8px;
  scroll-padding-bottom: 10px;
}
@media (max-width: 340px) {
  body.mobile-ui #endModal .modal-actions {
    grid-template-columns: 1fr;
  }
  body.mobile-ui #endModal #endReplayBtn {
    grid-column: auto;
  }
}
body.mobile-ui #endModal .end-hero-card,
body.mobile-ui #endModal .end-grade-card,
body.mobile-ui #endModal .end-compare-card,
body.mobile-ui #endModal .end-next-goal,
body.mobile-ui #endModal .end-challenge-card,
body.mobile-ui #endModal .end-bounty-card,
body.mobile-ui #endModal .end-city-card,
body.mobile-ui #endModal .end-opening-plan,
body.mobile-ui #endModal .end-share-card,
body.mobile-ui #endModal .end-run-card,
body.mobile-ui #endModal .end-career-card,
body.mobile-ui #endModal .end-badges {
  padding: 8px;
  margin-bottom: 7px;
}
body.mobile-ui #endModal .end-hero-main {
  grid-template-columns: minmax(0, 1.05fr) minmax(108px, 0.95fr);
  gap: 7px;
}
body.mobile-ui #endModal .end-hero-goals {
  gap: 6px;
  margin-top: 7px;
}
body.mobile-ui #endModal .end-hero-card .end-next-goal,
body.mobile-ui #endModal .end-hero-card .end-compare-card {
  padding: 7px;
}
body.mobile-ui #endModal .end-hero-card .end-next-goal strong,
body.mobile-ui #endModal .end-hero-card .end-compare-card strong {
  font-size: 13px;
}
body.mobile-ui #endModal .end-hero-score {
  padding-left: 7px;
}
body.mobile-ui #endModal .end-hero-score small strong {
  display: inline;
  font-size: inherit;
  margin: 0;
}
body.mobile-ui #endModal .end-grade-card strong,
body.mobile-ui #endModal .end-hero-card strong,
body.mobile-ui #endModal .end-next-goal strong,
body.mobile-ui #endModal .end-city-card strong,
body.mobile-ui #endModal .end-challenge-card strong {
  font-size: 17px;
}
body.mobile-ui #endModal .end-opening-plan ol {
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
}
body.mobile-ui #endModal .end-grade-card small,
body.mobile-ui #endModal .end-hero-card small,
body.mobile-ui #endModal .end-next-goal small,
body.mobile-ui #endModal .end-city-card small,
body.mobile-ui #endModal .end-challenge-card small {
  font-size: 11px;
}
body.mobile-ui #endModal .end-share-card p {
  max-height: 132px;
  font-size: 12px;
}
@media (max-width: 370px) {
  body.mobile-ui #endModal .end-hero-main {
    grid-template-columns: 1fr;
  }
  body.mobile-ui #endModal .end-hero-score {
    border-left: 0;
    border-top: 1px solid rgba(150, 171, 207, 0.65);
    padding: 7px 0 0;
  }
}
body.mobile-ui #endModal .end-career-grid {
  gap: 5px;
}
body.mobile-ui #endModal .career-stat {
  padding: 6px;
}
body.mobile-ui #endModal .career-stat strong {
  font-size: 14px;
}
body.mobile-ui #endModal .end-badge-list {
  gap: 5px;
}
body.mobile-ui #endModal .end-badge {
  min-width: 84px;
  padding: 5px 7px;
}
body.mobile-ui #guestSaveModal {
  place-items: end center;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
body.mobile-ui #guestSaveModal .guest-save-card {
  width: min(380px, calc(100vw - 18px));
  max-height: calc(100dvh - 18px);
  padding: 12px;
  overflow: auto;
}
body.mobile-ui #guestSaveModal h3 {
  margin-bottom: 6px;
  font-size: 17px;
}
body.mobile-ui #guestSaveModal label {
  display: grid;
  gap: 6px;
  color: #606574;
  font-size: 12px;
  font-weight: 700;
}
body.mobile-ui #guestNicknameInput {
  min-height: 48px;
  font-size: 16px;
}
body.mobile-ui .guest-save-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 10px;
}
body.mobile-ui .guest-save-actions button {
  min-height: 44px;
}
.logs div {
  padding: 6px 8px;
  border-radius: 8px;
  background: #efeff3;
  border: 1px solid #dedee5;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(22, 26, 38, 0.42);
  display: grid;
  place-items: center;
  z-index: 200;
}
.guide-tip {
  position: fixed;
  right: 14px;
  bottom: 16px;
  z-index: 140;
  width: min(340px, calc(100vw - 18px));
  border: 1px solid #d9bc7f;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8eb, #f5ecda);
  box-shadow: 0 12px 28px rgba(32, 38, 52, 0.22);
  padding: 10px 10px 8px;
  animation: guidePopIn 200ms ease-out;
}
.guide-tip p {
  margin: 0 0 8px 0;
  font-size: 12px;
  line-height: 1.42;
  color: #44331a;
}
.guide-tip-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.guide-tip-actions button {
  min-height: 28px;
  font-size: 12px;
  padding: 4px 8px;
}
@keyframes guidePopIn {
  0% { transform: translateY(8px) scale(0.98); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.place-dock {
  margin-bottom: 8px;
}
.place-dock-head {
  align-items: baseline;
}
.place-dock-head .panel-note {
  margin: 0;
  font-size: 11px;
}
.place-dock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.place-district-block {
  border: 1px solid #d9deea;
  border-radius: 10px;
  padding: 5px;
}
.place-district-title {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4f5b70;
}
.place-district-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.place-dock-item {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #cfd6e6;
  background: #f3f7ff;
  padding: 3px 6px;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 1px;
}
.place-dock-item span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.place-dock-item small {
  font-size: 10px;
  color: #5f6777;
}
.place-dock-item.active {
  border-color: #bf9544;
  background: #f6ead1;
}
.inv-summary {
  display: grid;
  gap: 3px;
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 1px solid #d6dbe8;
  border-radius: 8px;
  background: #f8faff;
  font-size: 12px;
}
.pnl-up {
  color: #1f7a43;
  font-weight: 700;
}
.pnl-down {
  color: #9a2d2d;
  font-weight: 700;
}
.sellable-row {
  background: rgba(155, 199, 171, 0.16);
}
.muted-cell {
  color: #7a8292;
  font-weight: 600;
}
.end-hero-goals,
.end-bounty-card,
.end-challenge-card,
.end-opening-plan {
  display: none;
}
.market-news {
  margin-bottom: 8px;
}
.news-headline {
  margin: 2px 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #273246;
}
.news-effects {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}
.news-effect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #d8dce7;
  border-radius: 8px;
  padding: 5px 8px;
  background: #f8faff;
}
.news-effect-row strong {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-effect-row span {
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 12px;
}
.news-effect-row small {
  font-size: 10px;
  color: #6a7387;
}
.news-effect-row.up {
  border-color: #a5d0b5;
  background: #eef8f1;
}
.news-effect-row.up span {
  color: #1f7a43;
}
.news-effect-row.down {
  border-color: #e2b4b4;
  background: #fff1f1;
}
.news-effect-row.down span {
  color: #9a2d2d;
}
.news-effect-row.flat span {
  color: #63708a;
}
.modal.hidden { display: none; }
.modal-card {
  width: min(640px, calc(100vw - 24px));
  max-height: 70vh;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #d0d0d6;
  background: #f7f7fa;
  padding: 14px;
}
body.mobile-ui .place-dock {
  padding: 7px;
}
body.mobile-ui .place-dock-grid {
  grid-template-columns: 1fr;
  gap: 5px;
}
body.mobile-ui .place-district-items {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.mobile-ui .place-dock-item {
  min-height: 44px;
  padding: 3px 5px;
}
body.mobile-ui .place-dock-item span {
  font-size: 11px;
}
body.mobile-ui .place-dock-item small {
  font-size: 9px;
}
body.mobile-ui .inv-summary {
  font-size: 11px;
  gap: 2px;
  padding: 5px 6px;
}
body.mobile-ui .market-news {
  padding: 7px;
}
body.mobile-ui .news-headline {
  font-size: 12px;
}
body.mobile-ui .news-effect-row {
  gap: 6px;
  padding: 4px 6px;
}
body.mobile-ui .news-effect-row strong,
body.mobile-ui .news-effect-row span {
  font-size: 11px;
}
body.mobile-ui .news-effect-row small {
  font-size: 9px;
}
body.mobile-ui .guide-tip {
  right: 8px;
  left: 8px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: auto;
  padding: 8px 8px 6px;
}
body.mobile-ui .guide-tip p {
  font-size: 11px;
  margin-bottom: 6px;
}
body.mobile-ui .guide-tip-actions button {
  min-height: 26px;
  font-size: 11px;
  padding: 3px 7px;
}
@media (max-width: 420px) {
  body.mobile-ui .place-district-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.modal-card h3 { margin: 0 0 8px 0; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.modal-head h3 { margin: 0; }
.small-btn {
  min-width: 52px;
  padding: 5px 8px;
}
.modal-body {
  white-space: pre-wrap;
  line-height: 1.55;
  margin-bottom: 12px;
  color: #323849;
}
#endSummaryBody {
  white-space: normal;
}
.summary-card {
  width: min(460px, calc(100vw - 24px));
  padding: 12px;
}
.summary-card p {
  margin: 0 0 6px 0;
  font-size: 14px;
  line-height: 1.42;
}
.summary-card label {
  display: block;
  margin: 8px 0 4px;
  font-size: 12px;
  color: #606574;
}
.summary-card h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.start-goal-card {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #c8d8f0;
  border-radius: 8px;
  background: #f8fbff;
}
.start-goal-card > span {
  color: #6a7280;
  font-size: 11px;
  font-weight: 800;
}
.start-goal-card > strong {
  color: #172033;
  font-size: 18px;
  line-height: 1.2;
}
.start-goal-card > small {
  color: #4f5b6f;
  font-size: 12px;
  line-height: 1.35;
}
.start-goal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.start-goal-stat {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid #d4dfef;
  border-radius: 8px;
  background: #ffffff;
}
.start-goal-stat span {
  color: #6a7280;
  font-size: 10px;
  font-weight: 800;
}
.start-goal-stat strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #172033;
  font-size: 13px;
  line-height: 1.15;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.end-hero-card,
.end-grade-card,
.end-compare-card,
.end-next-goal,
.end-challenge-card,
.end-bounty-card,
.end-city-card,
.end-opening-plan,
.end-share-card,
.end-run-card,
.end-career-card,
.end-badges {
  border: 1px solid #d6deec;
  background: #f7f9fd;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.end-hero-card {
  background: linear-gradient(135deg, #eaf6ef, #f6f9ff 58%, #fff9e9);
  border-color: #abd3bd;
}
.end-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(118px, 0.85fr);
  gap: 8px;
  align-items: stretch;
}
.end-hero-grade,
.end-hero-score {
  display: grid;
  align-content: start;
  min-width: 0;
}
.end-hero-score {
  border-left: 1px solid rgba(150, 171, 207, 0.65);
  padding-left: 8px;
}
.end-hero-score small strong {
  display: inline;
  font-size: inherit;
  margin: 0;
}
.end-hero-goals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.end-hero-card .end-next-goal,
.end-hero-card .end-compare-card {
  margin: 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
}
.end-hero-card .end-next-goal strong,
.end-hero-card .end-compare-card strong {
  font-size: 15px;
}
.end-grade-card {
  background: linear-gradient(135deg, #eaf6ef, #f8faf7);
  border-color: #b8d9c5;
}
.end-compare-card {
  background: #f5f8ff;
  border-color: #c8d8f0;
}
.end-compare-card.compare-up {
  background: linear-gradient(135deg, #edf9f0, #f8faf7);
  border-color: #9fcfae;
}
.end-compare-card.compare-down {
  background: linear-gradient(135deg, #fff6ed, #f8faf7);
  border-color: #e3bd8a;
}
.end-challenge-card {
  background: linear-gradient(135deg, #fff8e9, #f8faf7);
  border-color: #e4c887;
}
.end-bounty-card {
  background: linear-gradient(135deg, #fff9e6, #eef8f0);
  border-color: #e0bf64;
}
.end-city-card {
  background: linear-gradient(135deg, #f2f7ff, #fff9ec);
  border-color: #b9cfee;
}
.end-city-card.unlocked {
  background: linear-gradient(135deg, #edf9f0, #fff7df);
  border-color: #9fcfae;
}
.end-opening-plan {
  background: linear-gradient(135deg, #edf7ff, #f8faf7);
  border-color: #b7d6ee;
}
.end-share-card {
  background: #f8fbff;
  border-color: #c8d8f0;
}
.end-share-card p {
  max-height: 152px;
  overflow: auto;
  margin: 7px 0 0;
  padding: 8px;
  border: 1px solid #d4dfef;
  border-radius: 8px;
  background: #ffffff;
  color: #233047;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.end-career-card {
  background: #f8fbff;
  border-color: #c8d8f0;
}
.end-run-card {
  background: linear-gradient(135deg, #f4f8ff, #f8faf7);
  border-color: #bfcfed;
}
.end-hero-card span,
.end-grade-card span,
.end-compare-card span,
.end-next-goal span,
.end-bounty-card span,
.end-city-card span,
.end-share-card span,
.end-opening-plan span,
.end-challenge-card span {
  display: block;
  color: #6a7280;
  font-size: 11px;
  font-weight: 800;
}
.end-hero-card strong,
.end-grade-card strong,
.end-compare-card strong,
.end-next-goal strong,
.end-bounty-card strong,
.end-city-card strong,
.end-challenge-card strong {
  display: block;
  color: #172033;
  font-size: 19px;
  line-height: 1.25;
  margin-top: 2px;
}
.end-hero-card small,
.end-grade-card small,
.end-compare-card small,
.end-next-goal small,
.end-bounty-card small,
.end-city-card small,
.end-challenge-card small {
  display: block;
  color: #4f5b6f;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}
.end-opening-plan ol {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding-left: 20px;
  color: #233047;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.end-opening-plan li::marker {
  color: #4f7ca3;
  font-weight: 900;
}
.end-career-title {
  display: block;
  color: #6a7280;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 7px;
}
.end-career-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.career-stat {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #d4dfef;
  border-radius: 8px;
  background: #ffffff;
}
.career-stat span {
  color: #6a7280;
  font-size: 10px;
  font-weight: 800;
}
.career-stat strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #172033;
  font-size: 15px;
  line-height: 1.18;
}
.career-stat small {
  color: #647086;
  font-size: 10px;
  line-height: 1.15;
}
.career-stat.is-record {
  border-color: #e2b85d;
  background: #fff8e9;
}
.career-stat.is-record small {
  color: #94640d;
  font-weight: 800;
}
.end-badges-title {
  display: block;
  color: #6a7280;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 6px;
}
.end-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.end-badge {
  display: grid;
  gap: 1px;
  min-width: 92px;
  padding: 6px 8px;
  border: 1px solid #c9d9c7;
  border-radius: 999px;
  background: #f0f8ef;
}
.end-badge strong {
  color: #203826;
  font-size: 12px;
  line-height: 1.15;
}
.end-badge small {
  color: #637167;
  font-size: 10px;
  line-height: 1.1;
}
.end-summary-lines {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.end-summary-lines p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}
#endReplayBtn {
  border-color: #7fb492;
  background: #dff2e6;
  color: #13231a;
  font-weight: 800;
}
.start-auth-actions {
  justify-content: flex-start;
  margin-bottom: 10px;
}
.ghost-btn {
  background: #f1f4fb;
  border: 1px solid #cdd5e6;
  color: #314059;
}

#debtStatCard.debt-guide-ready,
#miniDebtCard.debt-guide-ready {
  border-color: #c58a2b !important;
  background: linear-gradient(180deg, #fff7e8, #f8efd8) !important;
}

#repayModal .repay-card {
  width: min(560px, calc(100vw - 18px));
  max-height: min(62dvh, 520px);
  padding: 10px 12px 10px;
}

#repayModal h3 {
  margin: 0 0 6px 0;
  font-size: 30px;
  line-height: 1.04;
  letter-spacing: 0.01em;
}

#repayModal .modal-body {
  white-space: normal;
  line-height: 1.28;
  margin-bottom: 8px;
  display: grid;
  gap: 6px;
}

#repayModalInfo {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  color: #2d3548;
}

#repayModal .repay-label {
  margin: 0;
  font-size: 15px;
  color: #4d5568;
}

#repayModalAmount {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.08;
  padding: 7px 10px;
  border-radius: 10px;
}

#repayModal .repay-actions {
  margin-top: 2px;
  gap: 8px;
}

#repayModal .repay-actions button {
  min-height: 40px;
  font-size: 24px;
  padding: 4px 10px;
}

body.mobile-ui #repayModal .repay-card {
  width: min(420px, calc(100vw - 12px));
  max-height: min(56dvh, 420px);
  padding: 8px 10px 8px;
}

body.mobile-ui #repayModal h3 {
  font-size: 24px;
  margin-bottom: 4px;
}

body.mobile-ui #repayModalInfo {
  font-size: 17px;
  line-height: 1.2;
}

body.mobile-ui #repayModal .repay-label {
  font-size: 14px;
}

body.mobile-ui #repayModalAmount {
  font-size: 24px;
  padding: 5px 8px;
}

body.mobile-ui #repayModal .repay-actions button {
  min-height: 34px;
  font-size: 17px;
  padding: 4px 8px;
}

.account-card,
.leaderboard-card {
  width: min(560px, calc(100vw - 24px));
}

.account-section {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.account-section label {
  font-size: 12px;
  color: #606574;
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 8px;
}
.oauth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.google-mark {
  display: inline-grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(2, 6px);
  gap: 1px;
}
.g {
  width: 6px;
  height: 6px;
  border-radius: 2px;
}
.g-blue { background: #4285f4; }
.g-red { background: #db4437; }
.g-yellow { background: #f4b400; }
.g-green { background: #0f9d58; }

#userPanel .account-actions {
  grid-template-columns: repeat(3, minmax(90px, 1fr));
}
.claim-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.claim-copy-row input {
  margin-top: 0;
}

.user-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #dedee5;
  border-radius: 8px;
  background: #efeff3;
}

.user-row span {
  color: var(--muted);
  font-size: 12px;
}

.user-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.auth-message {
  min-height: 20px;
  margin-top: 10px;
  color: #5d6474;
  font-size: 13px;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
  max-height: 52vh;
  overflow: auto;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #dedee5;
  border-radius: 8px;
  background: #efeff3;
}
.leaderboard-list li.just-saved {
  border-color: #8db9e9;
  background: linear-gradient(180deg, #eff6ff 0%, #e8f1ff 100%);
  box-shadow: 0 0 0 1px rgba(116, 157, 216, 0.2) inset;
}

.leaderboard-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-list small {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 12px;
}

.rank-no {
  color: #687083;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 12px;
}

.fireworks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 120;
}
.firework {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  opacity: 0;
  box-shadow: 0 0 10px currentColor;
  animation: burst 3200ms cubic-bezier(.12,.84,.2,1) forwards;
}
@keyframes burst {
  0% { transform: translate(0, 0) scale(0.45); opacity: 0; }
  9% { opacity: 1; }
  55% { opacity: 0.96; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.25); opacity: 0; }
}

@media (max-width: 1100px) {
  body:not(.desktop-ui):not(.mobile-ui) .trade-grid,
  body:not(.desktop-ui):not(.mobile-ui) .bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile bento pass: quiet, direct, trading-first. */
body.mobile-ui {
  --bg1: #f5f5f7;
  --bg2: #f5f5f7;
  --card: #ffffff;
  --line: #e4e7ee;
  --text: #1d1d1f;
  --muted: #7b8190;
  background: #f5f5f7;
}
body.mobile-ui .app {
  max-width: 430px;
  padding: 6px 7px calc(12px + env(safe-area-inset-bottom));
}
body.mobile-ui .card,
body.mobile-ui .panel,
body.mobile-ui .mobile-status-strip {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
body.mobile-ui .topbar {
  min-height: 52px;
  padding: 8px 10px;
  border-color: rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}
body.mobile-ui #dayText {
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}
body.mobile-ui .mobile-top-cash {
  display: none;
}
body.mobile-ui .mobile-menu-btn {
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  background: #f2f4f8;
  font-size: 17px;
}
body.mobile-ui .mobile-status-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  padding: 0;
  margin: 6px 0;
}
body.mobile-ui .mini-stat,
body.mobile-ui .mini-stat-btn {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  padding: 7px 8px;
}
body.mobile-ui .mini-stat + .mini-stat,
body.mobile-ui .mini-stat + .mini-stat-btn,
body.mobile-ui .mini-stat-btn + .mini-stat {
  border-left: 1px solid #edf0f5;
}
body.mobile-ui .mini-stat span {
  color: #8a8f9b;
  font-size: 10px;
  font-weight: 700;
}
body.mobile-ui .mini-stat strong {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}
body.mobile-ui .trade-grid {
  gap: 7px;
}
body.mobile-ui .panel {
  padding: 10px;
}
body.mobile-ui .panel-head {
  margin-bottom: 8px;
}
body.mobile-ui h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1d1d1f;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  text-transform: none;
}
body.mobile-ui .loc-chip {
  border: 0;
  border-radius: 8px;
  background: #f5ead1;
  color: #7a5613;
  font-size: 14px;
  font-weight: 900;
  padding: 4px 9px;
}
body.mobile-ui #rumorBtn {
  min-height: 34px;
  min-width: 58px;
  border: 0;
  border-radius: 8px;
  background: #f2f4f8;
  color: #3c4658;
  font-weight: 800;
}
body.mobile-ui .table-scroll {
  max-height: 54vh;
  border: 0;
  border-radius: 8px;
  background: #f7f8fb;
}
body.mobile-ui #invPanel .table-scroll {
  max-height: 28vh;
}
body.mobile-ui th {
  background: #f1f3f7;
  color: #8a8f9b;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}
body.mobile-ui td {
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 750;
}
body.mobile-ui td:nth-child(2),
body.mobile-ui td:nth-child(3) {
  font-weight: 900;
}
body.mobile-ui tr:hover {
  background: transparent;
}
body.mobile-ui tr.selected {
  background: #eaf2ff;
}
body.mobile-ui tr.owned,
body.mobile-ui .sellable-row {
  background: #f0f8f2;
}
body.mobile-ui td .deal-badge,
body.mobile-ui td .price-tag {
  border: 0;
  border-radius: 6px;
  font-size: 10px;
}
body.mobile-ui .inv-summary {
  border: 0;
  border-radius: 8px;
  background: #f7f8fb;
  color: #3c4658;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 8px;
  padding: 8px 10px;
}
body.mobile-ui .empty-position,
body.mobile-ui .empty-row td {
  color: #8a8f9b;
  font-weight: 800;
}
body.mobile-ui #opsPanel {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.72fr);
  gap: 8px;
}
body.mobile-ui #opsPanel label {
  color: #6f7582;
  font-size: 12px;
  font-weight: 800;
}
body.mobile-ui input {
  min-height: 40px;
  border: 1px solid #e0e4ec;
  border-radius: 8px;
  background: #f8f9fb;
  color: #1d1d1f;
  font-size: 16px;
}
body.mobile-ui button {
  border-radius: 8px;
  font-weight: 850;
}
body.mobile-ui #buyBtn,
body.mobile-ui #sellBtn {
  min-height: 40px;
  border: 0;
  background: #1d1d1f;
  color: #ffffff;
}
body.mobile-ui .quick-trade-row button {
  min-height: 38px;
  border: 0;
  background: #eef2f8;
  color: #3c4658;
}
body.mobile-ui #tradeHint {
  color: #8a8f9b;
  font-size: 12px;
  font-weight: 700;
}
body.mobile-ui .place-dock,
body.mobile-ui .market-news,
body.mobile-ui #bottomSection,
body.mobile-ui #logsSection {
  margin-top: 7px;
}

/* Mobile bento refinement: sharp, quiet, trading-centered. */
body.mobile-ui {
  --bento-bg: #f5f5f7;
  --bento-card: #ffffff;
  --bento-ink: #111113;
  --bento-muted: #737780;
  --bento-line: rgba(17, 17, 19, 0.08);
  --bento-soft: #f2f3f6;
  --bento-blue: #007aff;
  --bento-green: #1f8f4d;
  background: var(--bento-bg);
  color: var(--bento-ink);
}

body.mobile-ui .app {
  max-width: 460px;
  padding: 8px 8px calc(14px + env(safe-area-inset-bottom));
}

body.mobile-ui .topbar,
body.mobile-ui .mobile-status-strip,
body.mobile-ui .panel,
body.mobile-ui .card {
  border: 1px solid var(--bento-line);
  border-radius: 8px;
  background: var(--bento-card);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02), 0 12px 28px rgba(31, 35, 45, 0.05);
}

body.mobile-ui .topbar {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 20;
  min-height: 50px;
  margin-bottom: 8px;
  padding: 8px 10px;
  backdrop-filter: blur(18px);
}

body.mobile-ui #dayText {
  color: var(--bento-ink);
  font-size: 15px;
  font-weight: 850;
}

body.mobile-ui .mobile-menu-btn,
body.mobile-ui .avatar-btn {
  border: 0;
  background: var(--bento-soft);
  color: var(--bento-ink);
}

body.mobile-ui .mobile-status-strip {
  display: grid;
  grid-template-columns: 1.25fr 1fr 0.86fr 0.86fr;
  gap: 0;
  margin: 0 0 8px;
  overflow: hidden;
  padding: 0;
}

body.mobile-ui .mini-stat,
body.mobile-ui .mini-stat-btn {
  min-height: 54px;
  border: 0;
  border-left: 1px solid var(--bento-line);
  border-radius: 0;
  background: transparent;
  padding: 8px 9px;
}

body.mobile-ui .mini-stat:first-child,
body.mobile-ui .mini-stat-btn:first-child {
  border-left: 0;
}

body.mobile-ui .mini-stat span {
  color: var(--bento-muted);
  font-size: 10px;
  font-weight: 750;
}

body.mobile-ui .mini-stat strong {
  color: var(--bento-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
}

body.mobile-ui .opportunity-strip,
body.mobile-ui .market-news,
body.mobile-ui #bottomSection,
body.mobile-ui #logsSection,
body.mobile-ui #marketPanel .panel-note,
body.mobile-ui #tradeHint,
body.mobile-ui #rumorBtn {
  display: none !important;
}

body.mobile-ui.mobile-view-trade #tradeSection,
body.mobile-ui .trade-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "market"
    "inv"
    "ops";
  gap: 8px;
  margin-bottom: 8px;
}

body.mobile-ui.mobile-view-trade #marketPanel,
body.mobile-ui #marketPanel {
  grid-area: market;
}

body.mobile-ui.mobile-view-trade #invPanel,
body.mobile-ui #invPanel {
  grid-area: inv;
}

body.mobile-ui.mobile-view-trade #opsPanel,
body.mobile-ui #opsPanel {
  grid-area: ops;
}

body.mobile-ui .panel {
  padding: 10px;
}

body.mobile-ui .panel-head {
  min-height: 30px;
  margin-bottom: 8px;
}

body.mobile-ui h2 {
  color: var(--bento-ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
}

body.mobile-ui .loc-chip {
  border-radius: 8px;
  background: #eef2ff;
  color: #2450a8;
  font-size: 13px;
  font-weight: 850;
  padding: 4px 8px;
}

body.mobile-ui .table-scroll,
body.mobile-ui.mobile-view-trade #marketPanel .table-scroll,
body.mobile-ui.mobile-view-trade #invPanel .table-scroll {
  max-height: none;
  border: 1px solid var(--bento-line);
  border-radius: 8px;
  background: #fbfbfd;
  overflow: auto;
}

body.mobile-ui #marketPanel .table-scroll {
  max-height: 36dvh;
}

body.mobile-ui #invPanel .table-scroll {
  max-height: 24dvh;
}

body.mobile-ui table {
  border-collapse: separate;
  border-spacing: 0;
}

body.mobile-ui th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--bento-line);
  background: rgba(251, 251, 253, 0.96);
  color: var(--bento-muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: none;
}

body.mobile-ui td {
  border-bottom: 1px solid rgba(17, 17, 19, 0.055);
  color: var(--bento-ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.25;
  padding: 9px 8px;
}

body.mobile-ui tbody tr:last-child td {
  border-bottom: 0;
}

body.mobile-ui td:nth-child(2),
body.mobile-ui td:nth-child(3) {
  font-weight: 900;
}

body.mobile-ui tr.selected {
  background: #e8f1ff;
  box-shadow: inset 3px 0 0 var(--bento-blue);
}

body.mobile-ui tr.owned,
body.mobile-ui .sellable-row {
  background: #eff9f2;
}

body.mobile-ui td .deal-badge,
body.mobile-ui td .price-tag {
  display: inline-flex;
  margin-left: 5px;
  border: 0;
  border-radius: 6px;
  background: #ebedf2;
  color: #696f79;
  font-size: 10px;
  font-weight: 850;
  padding: 2px 5px;
}

body.mobile-ui .pnl-up {
  color: var(--bento-green);
}

body.mobile-ui .pnl-down {
  color: #b42318;
}

body.mobile-ui .inv-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  margin-bottom: 8px;
  border: 1px solid var(--bento-line);
  border-radius: 8px;
  background: #fbfbfd;
  color: #42464f;
  font-size: 12px;
  font-weight: 760;
  padding: 8px;
}

body.mobile-ui #opsPanel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 0.62fr);
  gap: 8px;
  align-self: stretch;
}

body.mobile-ui #opsPanel h2,
body.mobile-ui #opsPanel .quick-trade-row {
  grid-column: 1 / -1;
}

body.mobile-ui #opsPanel label {
  display: grid;
  gap: 5px;
  color: var(--bento-muted);
  font-size: 11px;
  font-weight: 850;
}

body.mobile-ui #opsPanel hr {
  display: none;
}

body.mobile-ui input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--bento-line);
  border-radius: 8px;
  background: #fbfbfd;
  color: var(--bento-ink);
  font-size: 16px;
  font-weight: 850;
}

body.mobile-ui #buyBtn,
body.mobile-ui #sellBtn,
body.mobile-ui .quick-trade-row button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
}

body.mobile-ui #buyBtn,
body.mobile-ui #sellBtn {
  background: var(--bento-ink);
  color: #ffffff;
}

body.mobile-ui .quick-trade-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.mobile-ui .quick-trade-row button {
  background: var(--bento-soft);
  color: var(--bento-ink);
}

body.mobile-ui .place-dock {
  margin-top: 0;
  padding: 10px;
}

body.mobile-ui .place-dock-head {
  margin-bottom: 8px;
}

body.mobile-ui .place-dock-head .panel-note {
  display: none;
}

body.mobile-ui .place-dock-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

body.mobile-ui .place-district-title {
  margin: 0 0 5px;
  color: var(--bento-muted);
  font-size: 10px;
  font-weight: 850;
}

body.mobile-ui .place-district-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body.mobile-ui .place-dock-item {
  min-height: 38px;
  border: 1px solid var(--bento-line);
  border-radius: 8px;
  background: #fbfbfd;
  color: var(--bento-ink);
  padding: 5px 6px;
}

body.mobile-ui .place-dock-item span {
  font-size: 12px;
  font-weight: 850;
}

body.mobile-ui .place-dock-item.active {
  border-color: rgba(0, 122, 255, 0.34);
  background: #e8f1ff;
  color: #0049a8;
}

@media (max-width: 420px) {
  body.mobile-ui.mobile-view-trade #tradeSection {
    grid-template-columns: 1fr;
    grid-template-areas:
      "market"
      "inv"
      "ops";
  }

  body.mobile-ui #marketPanel .table-scroll {
    max-height: 34dvh;
  }

  body.mobile-ui #invPanel .table-scroll {
    max-height: 22dvh;
  }
}

/* Mobile place switcher: two rows, sixteen direct addresses. */
body.mobile-ui .mobile-status-strip {
  margin-bottom: 6px;
}

body.mobile-ui .place-dock {
  margin: 0 0 8px;
  padding: 6px;
}

body.mobile-ui .place-dock-head {
  display: none;
}

body.mobile-ui .place-dock-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: 34px;
  gap: 4px;
}

body.mobile-ui .place-dock-item {
  min-width: 0;
  min-height: 34px;
  padding: 2px 3px;
}

body.mobile-ui .place-dock-item span {
  display: block;
  color: inherit;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-align: center;
}

/* Mobile thumb trade dock and softer boarding-pass cards. */
.mobile-trade-dock {
  display: none;
}

body.mobile-ui {
  background: #e7e7e9;
}

body.mobile-ui .app {
  padding-bottom: calc(148px + env(safe-area-inset-bottom));
}

body.mobile-ui .topbar,
body.mobile-ui .mobile-status-strip,
body.mobile-ui .panel,
body.mobile-ui .card {
  border-color: rgba(15, 15, 18, 0.07);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(24, 28, 38, 0.08);
}

body.mobile-ui .table-scroll,
body.mobile-ui .inv-summary {
  border-radius: 16px;
}

body.mobile-ui .place-dock {
  border-radius: 20px;
}

body.mobile-ui .place-dock-item {
  border-radius: 12px;
}

body.mobile-ui.mobile-view-trade #tradeSection,
body.mobile-ui .trade-grid {
  grid-template-areas:
    "market"
    "inv"
    "ops";
}

body.mobile-ui .mobile-trade-dock {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 96;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(108px, 0.42fr);
  grid-template-areas:
    "info actions"
    "stepper actions";
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 60px rgba(9, 12, 20, 0.24);
  backdrop-filter: blur(22px);
}

body.mobile-ui .mobile-trade-info {
  grid-area: info;
  display: grid;
  min-width: 0;
  gap: 2px;
}

body.mobile-ui .mobile-trade-info span {
  width: fit-content;
  border-radius: 999px;
  background: #e8f1ff;
  color: #0057c2;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
}

body.mobile-ui .mobile-trade-dock.mode-sell .mobile-trade-info span {
  background: #e9f8ef;
  color: #14723a;
}

body.mobile-ui .mobile-trade-info strong {
  min-width: 0;
  overflow: hidden;
  color: #09090b;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui .mobile-trade-info small {
  min-width: 0;
  overflow: hidden;
  color: #777b84;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui .mobile-trade-stepper {
  grid-area: stepper;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  overflow: hidden;
  min-height: 44px;
  border: 1px solid rgba(15, 15, 18, 0.08);
  border-radius: 16px;
  background: #f4f4f6;
}

body.mobile-ui .mobile-trade-stepper button {
  min-width: 40px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111113;
  font-size: 22px;
  font-weight: 850;
}

body.mobile-ui .mobile-trade-stepper input {
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111113;
  font-size: 19px;
  font-weight: 950;
  text-align: center;
}

body.mobile-ui .mobile-trade-actions {
  grid-area: actions;
  display: grid;
  grid-template-rows: minmax(56px, 1fr) minmax(42px, auto);
  gap: 8px;
}

body.mobile-ui .mobile-trade-actions button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  font-weight: 950;
}

body.mobile-ui #mobileTradePrimaryBtn {
  background: #08080a;
  color: #ffffff;
  font-size: 18px;
}

body.mobile-ui #mobileTradeMaxBtn {
  background: #54f08b;
  color: #07150d;
  font-size: 13px;
}

body.mobile-ui .mobile-trade-dock.is-disabled #mobileTradePrimaryBtn,
body.mobile-ui .mobile-trade-dock.is-disabled #mobileTradeMaxBtn,
body.mobile-ui .mobile-trade-dock.is-disabled .mobile-trade-stepper {
  opacity: 0.46;
}

body.mobile-ui .mobile-trade-dock button:disabled,
body.mobile-ui .mobile-trade-dock input:disabled {
  opacity: 0.55;
}

/* Mobile trade tables: buy and sell side by side. */
body.mobile-ui.mobile-view-trade #tradeSection,
body.mobile-ui .trade-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "market inv";
  align-items: stretch;
  gap: 8px;
}

body.mobile-ui #marketPanel,
body.mobile-ui #invPanel {
  min-width: 0;
  padding: 9px;
}

body.mobile-ui #marketPanel .panel-head,
body.mobile-ui #invPanel .panel-head {
  min-height: 24px;
  margin-bottom: 7px;
}

body.mobile-ui #marketPanel h2,
body.mobile-ui #invPanel h2 {
  font-size: 16px;
}

body.mobile-ui #marketPanel .loc-chip {
  max-width: 72px;
  overflow: hidden;
  padding: 4px 7px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui #marketPanel .table-scroll,
body.mobile-ui #invPanel .table-scroll,
body.mobile-ui.mobile-view-trade #marketPanel .table-scroll,
body.mobile-ui.mobile-view-trade #invPanel .table-scroll {
  max-height: 43dvh;
}

body.mobile-ui #marketTable th,
body.mobile-ui #marketTable td,
body.mobile-ui #invTable th,
body.mobile-ui #invTable td {
  padding: 8px 6px;
  font-size: 12px;
}

body.mobile-ui #marketTable th {
  font-size: 10px;
}

body.mobile-ui #invTable th {
  font-size: 10px;
}

body.mobile-ui #marketTable th:nth-child(1),
body.mobile-ui #marketTable td:nth-child(1) {
  width: 56%;
}

body.mobile-ui #marketTable th:nth-child(2),
body.mobile-ui #marketTable td:nth-child(2) {
  width: 44%;
}

body.mobile-ui #invTable th:nth-child(1),
body.mobile-ui #invTable td:nth-child(1) {
  width: 42%;
}

body.mobile-ui #invTable th:nth-child(2),
body.mobile-ui #invTable td:nth-child(2) {
  width: 27%;
}

body.mobile-ui #invTable th:nth-child(3),
body.mobile-ui #invTable td:nth-child(3) {
  width: 31%;
}

body.mobile-ui #invTable td {
  font-size: 11px;
}

body.mobile-ui #invTable td br {
  display: none;
}

body.mobile-ui #invTable td .deal-badge,
body.mobile-ui #invTable td .price-tag,
body.mobile-ui #marketTable td .price-tag {
  margin-left: 0;
  margin-top: 3px;
  font-size: 9px;
  padding: 1px 4px;
}

body.mobile-ui #invPanel .inv-summary {
  margin-bottom: 7px;
  padding: 7px;
  font-size: 10px;
}

@media (max-width: 380px) {
  body.mobile-ui.mobile-view-trade #tradeSection,
  body.mobile-ui .trade-grid {
    gap: 6px;
  }

  body.mobile-ui #marketPanel,
  body.mobile-ui #invPanel {
    padding: 7px;
  }

  body.mobile-ui #marketTable th,
  body.mobile-ui #marketTable td,
  body.mobile-ui #invTable th,
  body.mobile-ui #invTable td {
    padding: 7px 5px;
    font-size: 11px;
  }
}

/* Mobile status shortcuts and iOS-style guide badges. */
body.mobile-ui .mobile-status-strip .mini-stat-btn {
  position: relative;
  display: grid;
  gap: 2px;
  justify-items: start;
  min-width: 0;
  font-family: inherit;
}

body.mobile-ui .mini-stat-btn.status-guide-badge::after {
  content: "1";
  position: absolute;
  top: 5px;
  right: 7px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #ff3b30;
  color: #ffffff;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(255, 59, 48, 0.3);
}

body.mobile-ui .mini-stat-btn.status-guide-badge {
  background: #fff9f2;
}

/* Mobile refinements: decisive all-in button, clear capacity cost, richer place grid. */
body.mobile-ui .mobile-status-strip {
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr);
}

body.mobile-ui .mini-stat strong,
body.mobile-ui .mini-stat-btn strong {
  font-size: 10px;
}

body.mobile-ui .place-dock-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 32px;
}

body.mobile-ui .place-dock-item.district-xihu {
  border-color: #82d49c;
  background: #ecfff1;
}

body.mobile-ui .place-dock-item.district-shangcheng {
  border-color: #f1b06a;
  background: #fff5e9;
}

body.mobile-ui .place-dock-item.district-gongshu {
  border-color: #7bb3ee;
  background: #edf7ff;
}

body.mobile-ui .place-dock-item.district-binjiang {
  border-color: #a996ea;
  background: #f4f0ff;
}

body.mobile-ui .place-dock-item.district-yuhang {
  border-color: #75cdbc;
  background: #ebfffb;
}

body.mobile-ui .place-dock-item.district-xiaoshan {
  border-color: #ee9bb8;
  background: #fff0f6;
}

body.mobile-ui .place-dock-item.active {
  border-color: #111113;
  background: #111113;
  color: #ffffff;
}

#capacityCostText {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 16px;
  background: #fff7e8;
}

#capacityCostText span {
  color: #78614a;
  font-size: 12px;
  font-weight: 850;
}

#capacityCostText strong {
  color: #09090b;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 950;
  line-height: 1;
}

#capacityCostText small {
  color: #7a7065;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

#capacityCostText small:nth-of-type(3) {
  color: #9a520f;
  font-weight: 900;
}

body.mobile-ui .mobile-trade-dock {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.46fr);
  grid-template-areas:
    "info max"
    "stepper primary";
  align-items: stretch;
  gap: 9px;
}

body.mobile-ui .mobile-trade-info {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 8px;
  row-gap: 3px;
}

body.mobile-ui .mobile-trade-info span {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

body.mobile-ui .mobile-trade-info strong {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  font-size: 16px;
}

body.mobile-ui .mobile-trade-info small {
  grid-column: 1 / -1;
  grid-row: 2;
}

body.mobile-ui .mobile-trade-actions {
  display: contents;
}

body.mobile-ui #mobileTradeMaxBtn {
  grid-area: max;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #08080a;
  color: #ffffff;
}

body.mobile-ui #mobileTradeMaxBtn span {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}

body.mobile-ui #mobileTradeMaxBtn strong {
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

body.mobile-ui #mobileTradePrimaryBtn {
  grid-area: primary;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 16px;
  background: #54f08b;
  color: #07150d;
  font-size: 13px;
}

body.mobile-ui .mobile-trade-stepper {
  min-height: 44px;
}

body.mobile-ui #invTable {
  table-layout: auto;
}

body.mobile-ui #invTable th:nth-child(1),
body.mobile-ui #invTable td:nth-child(1) {
  width: 52%;
}

body.mobile-ui #invTable th:nth-child(2),
body.mobile-ui #invTable td:nth-child(2) {
  width: 18%;
}

body.mobile-ui #invTable th:nth-child(3),
body.mobile-ui #invTable td:nth-child(3) {
  width: 30%;
}

body.mobile-ui #invTable td:first-child span {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: keep-all;
}

body.mobile-ui #invTable td {
  font-size: 12px;
  line-height: 1.22;
}

/* International grid UI pass, adapted from output/international-grid-ui.html. */
body.mobile-ui {
  --intl-paper: #f7f6f1;
  --intl-ink: #111111;
  --intl-muted: #77756e;
  --intl-line: #4f4f4a;
  --intl-soft: #d7d3c8;
  --intl-accent: #00a7c8;
  --intl-red: #c92018;
  --intl-cold: #2e3031;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.045) 1px, transparent 1px) 0 0 / 64px 64px,
    #d6d4cd;
  color: var(--intl-ink);
  font-family: Helvetica, Arial, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
}

body.mobile-ui .app {
  width: min(430px, calc(100vw - 16px));
  max-width: 430px;
  margin: 8px auto;
  padding: 0 0 calc(150px + env(safe-area-inset-bottom));
  border: 1px solid var(--intl-line);
  background: var(--intl-paper);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.22);
}

body.mobile-ui .topbar,
body.mobile-ui .mobile-status-strip,
body.mobile-ui .place-dock,
body.mobile-ui #marketPanel,
body.mobile-ui #invPanel,
body.mobile-ui .mobile-trade-dock {
  border: 0;
  border-radius: 0;
  background: var(--intl-paper);
  box-shadow: none;
}

body.mobile-ui .topbar {
  position: static;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 84px;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--intl-line);
}

body.mobile-ui .topbar-brand {
  display: grid;
  grid-column: 1 / 5;
  align-content: end;
  min-width: 0;
  padding: 0 18px 12px;
  border-right: 1px solid var(--intl-line);
}

body.mobile-ui #dayText {
  color: var(--intl-ink);
  font-size: 30px;
  font-weight: 900;
  line-height: 0.95;
}

body.mobile-ui .top-actions {
  grid-column: 5 / 7;
  display: grid;
  place-items: stretch;
}

body.mobile-ui .mobile-menu-btn {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  border-radius: 0;
  background: transparent;
  color: var(--intl-ink);
  font-size: 42px;
  font-weight: 900;
}

body.mobile-ui .avatar-btn {
  display: none;
}

body.mobile-ui .mobile-status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, 58px);
  gap: 0;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--intl-line);
}

body.mobile-ui #mobileStatusStrip > .mini-stat:first-child {
  grid-column: 1 / 5;
  grid-row: 1 / 3;
  align-content: center;
  padding: 12px 16px 10px;
  border-right: 1px solid var(--intl-line);
}

body.mobile-ui #miniDebtCard {
  grid-column: 5 / 7;
  grid-row: 1;
}

body.mobile-ui #miniItemsCard {
  grid-column: 5 / 6;
  grid-row: 2;
}

body.mobile-ui #mobileStatusStrip > .mini-stat:nth-of-type(2) {
  grid-column: 6 / 7;
  grid-row: 2;
}

body.mobile-ui .mini-stat,
body.mobile-ui .mini-stat-btn {
  align-content: center;
  min-height: 0;
  border: 0;
  border-left: 0;
  border-bottom: 1px solid var(--intl-soft);
  border-radius: 0;
  background: transparent;
  padding: 6px 10px;
  text-align: left;
}

body.mobile-ui #miniDebtCard,
body.mobile-ui #miniItemsCard {
  border-right: 1px solid var(--intl-soft);
}

body.mobile-ui .mini-stat span,
body.mobile-ui .mini-stat-btn span {
  color: var(--intl-muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui .mini-stat strong,
body.mobile-ui .mini-stat-btn strong {
  color: var(--intl-ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui #mobileStatusStrip > .mini-stat:first-child strong {
  margin-top: 4px;
  font-size: clamp(34px, 11vw, 54px);
  letter-spacing: 0;
}

body.mobile-ui #miniDebt {
  color: var(--intl-red);
}

body.mobile-ui .place-dock {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--intl-line);
}

body.mobile-ui .place-dock-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 42px;
  gap: 0;
}

body.mobile-ui .place-dock-item {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--intl-soft);
  border-bottom: 1px solid var(--intl-soft);
  border-radius: 0;
  background: var(--intl-paper);
  color: var(--intl-ink);
  padding: 4px;
}

body.mobile-ui .place-dock-item:nth-child(6n) {
  border-right: 0;
}

body.mobile-ui .place-dock-item span {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
}

body.mobile-ui .place-dock-item.district-xihu,
body.mobile-ui .place-dock-item.district-shangcheng,
body.mobile-ui .place-dock-item.district-gongshu,
body.mobile-ui .place-dock-item.district-binjiang,
body.mobile-ui .place-dock-item.district-yuhang,
body.mobile-ui .place-dock-item.district-xiaoshan {
  background: var(--intl-paper);
}

body.mobile-ui .place-dock-item.district-xihu { color: #187142; }
body.mobile-ui .place-dock-item.district-shangcheng { color: #9a520f; }
body.mobile-ui .place-dock-item.district-gongshu { color: #135f9f; }
body.mobile-ui .place-dock-item.district-binjiang { color: #5b3db0; }
body.mobile-ui .place-dock-item.district-yuhang { color: #0f766e; }
body.mobile-ui .place-dock-item.district-xiaoshan { color: #a51d57; }

body.mobile-ui .place-dock-item.active {
  border-color: var(--intl-cold);
  background: var(--intl-cold);
  color: var(--intl-paper);
}

body.mobile-ui.mobile-view-trade #tradeSection,
body.mobile-ui .trade-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-areas: "market market market inv inv inv";
  gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--intl-line);
}

body.mobile-ui #marketPanel {
  grid-column: 1 / 4;
  grid-area: market;
  min-width: 0;
  padding: 0;
  border-right: 1px solid var(--intl-line);
}

body.mobile-ui #invPanel {
  grid-column: 4 / 7;
  grid-area: inv;
  min-width: 0;
  padding: 0;
}

body.mobile-ui #marketPanel .panel-head,
body.mobile-ui #invPanel > h2 {
  display: grid;
  min-height: 48px;
  margin: 0;
  padding: 0 10px;
  align-content: center;
  border-bottom: 1px solid var(--intl-line);
}

body.mobile-ui #marketPanel h2,
body.mobile-ui #invPanel h2 {
  color: var(--intl-ink);
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui #marketPanel .loc-chip {
  max-width: 84px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--intl-ink);
  font-size: 18px;
  padding: 0;
}

body.mobile-ui .table-scroll,
body.mobile-ui #marketPanel .table-scroll,
body.mobile-ui #invPanel .table-scroll,
body.mobile-ui.mobile-view-trade #marketPanel .table-scroll,
body.mobile-ui.mobile-view-trade #invPanel .table-scroll {
  max-height: 48dvh;
  border: 0;
  border-radius: 0;
  background: var(--intl-paper);
}

body.mobile-ui .inv-summary {
  display: none;
}

body.mobile-ui table {
  border-collapse: collapse;
  table-layout: fixed;
}

body.mobile-ui th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 38px;
  border-bottom: 1px solid var(--intl-line);
  background: var(--intl-paper);
  color: var(--intl-muted);
  font-size: 12px;
  font-weight: 900;
}

body.mobile-ui td {
  height: 38px;
  border-bottom: 1px solid var(--intl-soft);
  color: var(--intl-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  padding: 4px 8px;
}

body.mobile-ui #marketTable th:nth-child(1),
body.mobile-ui #marketTable td:nth-child(1) {
  width: 66%;
}

body.mobile-ui #marketTable th:nth-child(2),
body.mobile-ui #marketTable td:nth-child(2) {
  width: 34%;
  text-align: right;
}

body.mobile-ui #invTable th:nth-child(1),
body.mobile-ui #invTable td:nth-child(1) {
  width: 54%;
}

body.mobile-ui #invTable th:nth-child(2),
body.mobile-ui #invTable td:nth-child(2) {
  width: 18%;
  text-align: right;
}

body.mobile-ui #invTable th:nth-child(3),
body.mobile-ui #invTable td:nth-child(3) {
  width: 28%;
  text-align: right;
}

body.mobile-ui #invTable td:first-child span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui tr.selected {
  background: transparent;
  box-shadow: inset 0 -3px 0 var(--intl-accent);
}

body.mobile-ui tr.owned,
body.mobile-ui .sellable-row {
  background: transparent;
}

body.mobile-ui td .deal-badge,
body.mobile-ui td .price-tag {
  display: none;
}

body.mobile-ui .mobile-trade-dock {
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  bottom: calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-areas:
    "info info info max max max"
    "stepper stepper stepper primary primary primary";
  gap: 0;
  max-width: 430px;
  padding: 0;
  border: 1px solid var(--intl-line);
  border-radius: 0;
  background: var(--intl-paper);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  backdrop-filter: none;
}

body.mobile-ui .mobile-trade-info {
  grid-area: info;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 92px;
  align-content: center;
  gap: 5px 8px;
  padding: 0 16px;
  border-right: 1px solid var(--intl-line);
  border-bottom: 1px solid var(--intl-line);
}

body.mobile-ui .mobile-trade-info span {
  grid-column: 1;
  grid-row: 1;
  border-radius: 0;
  background: transparent;
  color: var(--intl-muted);
  font-size: 14px;
  font-weight: 900;
  padding: 0;
}

body.mobile-ui .mobile-trade-info strong {
  grid-column: 2;
  grid-row: 1;
  color: var(--intl-ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui .mobile-trade-info small {
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--intl-muted);
  font-size: 13px;
  font-weight: 900;
}

body.mobile-ui .mobile-trade-stepper {
  grid-area: stepper;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 56px;
  border: 0;
  border-right: 1px solid var(--intl-line);
  border-radius: 0;
  background: var(--intl-paper);
}

body.mobile-ui .mobile-trade-stepper button,
body.mobile-ui .mobile-trade-stepper input {
  min-height: 56px;
  border: 0;
  border-right: 1px solid var(--intl-soft);
  border-radius: 0;
  background: var(--intl-paper);
  color: var(--intl-ink);
  font-size: 28px;
  font-weight: 900;
}

body.mobile-ui .mobile-trade-stepper button:last-child {
  border-right: 0;
}

body.mobile-ui .mobile-trade-actions {
  display: contents;
}

body.mobile-ui #mobileTradeMaxBtn {
  grid-area: max;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 92px;
  border: 0;
  border-bottom: 1px solid var(--intl-line);
  border-radius: 0;
  background: var(--intl-accent);
  color: var(--intl-paper);
  padding: 0 10px;
}

body.mobile-ui #mobileTradeMaxBtn span {
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui #mobileTradeMaxBtn strong {
  margin-top: 3px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui #mobileTradePrimaryBtn {
  grid-area: primary;
  min-height: 56px;
  border: 0;
  border-radius: 0;
  background: var(--intl-cold);
  color: var(--intl-paper);
  font-size: 25px;
  font-weight: 900;
}

body.mobile-ui .mobile-trade-dock.is-disabled #mobileTradePrimaryBtn,
body.mobile-ui .mobile-trade-dock.is-disabled #mobileTradeMaxBtn,
body.mobile-ui .mobile-trade-dock.is-disabled .mobile-trade-stepper {
  opacity: 0.55;
}

/* Screenshot tuning: compact title, 12 places, clean status stack. */
body.mobile-ui .topbar {
  min-height: 42px;
  height: 42px;
}

body.mobile-ui .topbar-brand {
  align-content: center;
  padding: 0 12px;
  overflow: hidden;
}

body.mobile-ui #dayText {
  overflow: visible;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

body.mobile-ui .mobile-menu-btn {
  font-size: 30px;
}

body.mobile-ui #mobileStatusStrip > .mini-stat:nth-of-type(2) {
  display: none;
}

body.mobile-ui #miniDebtCard {
  grid-column: 5 / 7;
  grid-row: 1;
  border-right: 0;
}

body.mobile-ui #miniItemsCard {
  grid-column: 5 / 7;
  grid-row: 2;
  border-right: 0;
}

body.mobile-ui .place-dock-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 42px;
}

body.mobile-ui .place-dock-item:nth-child(n + 13) {
  display: none;
}

body.mobile-ui #marketPanel .panel-head,
body.mobile-ui #invPanel > h2 {
  min-height: 48px;
}

body.mobile-ui #mobileTradeMaxBtn {
  justify-content: center;
  justify-items: center;
  text-align: center;
}

/* Compact integrated trading layout: restore day/capacity affordances and keep the dock attached. */
body.mobile-ui .app {
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

body.mobile-ui .topbar {
  min-height: 72px;
  height: auto;
}

body.mobile-ui .topbar-brand {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 5px;
  padding: 0 14px;
}

body.mobile-ui .top-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.mobile-ui .topbar-brand h1 {
  display: block;
  margin: 0;
  color: var(--intl-ink);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

body.mobile-ui .top-round-pill {
  flex: 0 0 auto;
  border: 1px solid var(--intl-line);
  border-radius: 999px;
  color: var(--intl-ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
}

body.mobile-ui #dayText,
body.mobile-ui .mobile-top-cash {
  display: none;
}

body.mobile-ui .top-news-ticker {
  display: block;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--intl-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.mobile-ui .mobile-status-strip {
  grid-template-rows: 92px;
}

body.mobile-ui #mobileStatusStrip > .mini-stat:first-child {
  grid-column: 1 / 5;
  grid-row: 1;
}

body.mobile-ui #miniDebtCard {
  grid-column: 5 / 7;
  grid-row: 1;
  border-right: 0;
}

body.mobile-ui #miniItemsCard,
body.mobile-ui #mobileStatusStrip > .mini-stat:nth-of-type(2),
body.mobile-ui #quickTravelBtn,
body.mobile-ui #quickExpandBtn {
  display: none;
}

body.mobile-ui .place-dock-item.district-xihu { background: #eef8f1; color: #187142; }
body.mobile-ui .place-dock-item.district-shangcheng { background: #fff4e6; color: #9a520f; }
body.mobile-ui .place-dock-item.district-gongshu { background: #eef6ff; color: #135f9f; }
body.mobile-ui .place-dock-item.district-binjiang { background: #f4f0ff; color: #5b3db0; }
body.mobile-ui .place-dock-item.district-yuhang { background: #eaf8f6; color: #0f766e; }
body.mobile-ui .place-dock-item.district-xiaoshan { background: #fff0f6; color: #a51d57; }

body.mobile-ui .place-dock-item.active {
  background: var(--intl-cold);
  color: var(--intl-paper);
}

body.mobile-ui #marketPanel .panel-head,
body.mobile-ui #invPanel .warehouse-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 48px;
  margin: 0;
  padding: 0 10px;
  align-items: center;
  border-bottom: 1px solid var(--intl-line);
}

body.mobile-ui #invPanel .warehouse-head h2 {
  margin: 0;
}

body.mobile-ui .capacity-chip {
  min-height: 28px;
  border: 1px solid var(--intl-line);
  border-radius: 999px;
  background: #f7f5ef;
  color: var(--intl-ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

body.mobile-ui .mobile-trade-dock {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  max-width: none;
  width: 100%;
  margin: 0;
  border-width: 0 0 1px;
  box-shadow: none;
}

body.mobile-ui .table-scroll,
body.mobile-ui #marketPanel .table-scroll,
body.mobile-ui #invPanel .table-scroll,
body.mobile-ui.mobile-view-trade #marketPanel .table-scroll,
body.mobile-ui.mobile-view-trade #invPanel .table-scroll {
  max-height: none;
  overflow: visible;
  scrollbar-width: none;
}

body.mobile-ui .table-scroll::-webkit-scrollbar,
body.mobile-ui #marketPanel .table-scroll::-webkit-scrollbar,
body.mobile-ui #invPanel .table-scroll::-webkit-scrollbar {
  display: none;
}

body.mobile-ui .table-scroll table {
  width: 100%;
  min-width: 0;
}

/* Toast-style status banner: float above the board instead of shifting layout. */
.save-banner {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 160;
  width: min(520px, calc(100vw - 28px));
  margin: 0;
  transform: translateX(-50%);
  box-shadow: 0 14px 36px rgba(20, 52, 35, 0.16);
}

body.mobile-ui .save-banner {
  top: calc(10px + env(safe-area-inset-top));
  width: min(400px, calc(100vw - 24px));
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  pointer-events: none;
}

#marketTable tbody tr.owned {
  background: #ffffff;
}

body.mobile-ui #marketTable tbody tr.owned {
  background: #ffffff;
}

/* Mobile playtest surface: keep the recommended-action loop visible. */
body.mobile-ui .round-progress {
  display: block !important;
}

body.mobile-ui #roundGoalText,
body.mobile-ui #roundBountyText,
body.mobile-ui #roundStreakText,
body.mobile-ui #roundGoalProgressTrack {
  display: block !important;
}

body.mobile-ui .opportunity-strip {
  display: grid !important;
}

body.mobile-ui .opportunity-primary {
  order: -1 !important;
  grid-column: 1 / -1 !important;
}

body.mobile-ui #invPanel,
body.mobile-ui #opsPanel {
  display: block !important;
}

body.mobile-ui .thumb-action-dock {
  display: grid !important;
}

/* Mini-program parity pass: mirror the canvas layout in minigame/game.js. */
.mini-ticker {
  display: none;
}

body.mobile-ui {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.mobile-ui {
  --mp-bg: #d8d7d0;
  --mp-paper: #f8f7f2;
  --mp-paper-alt: #fbfaf6;
  --mp-ink: #111111;
  --mp-muted: #777777;
  --mp-line: #444444;
  --mp-soft-line: #e0e0e0;
  --mp-faint-line: #ece9df;
  --mp-accent: #05aeca;
  --mp-cold: #2f3030;
  --mp-green: #187142;
  --mp-red: #c92018;
  background: var(--mp-bg);
  color: var(--mp-ink);
  font-family: Helvetica, Arial, "PingFang SC", "Noto Sans SC", sans-serif;
}

body.mobile-ui .app {
  display: grid;
  grid-template-rows: 52px 28px 78px 72px minmax(0, 1fr) 150px;
  width: min(430px, calc(100vw - 12px));
  max-width: 430px;
  height: calc(100dvh - 12px);
  min-height: 520px;
  margin: 6px auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--mp-soft-line);
  border-radius: 0;
  background: var(--mp-paper);
  box-shadow: none;
}

body.mobile-ui .topbar,
body.mobile-ui .mini-ticker,
body.mobile-ui .mobile-status-strip,
body.mobile-ui .place-dock,
body.mobile-ui #marketPanel,
body.mobile-ui #invPanel,
body.mobile-ui .mobile-trade-dock {
  border-color: var(--mp-soft-line);
  border-radius: 0;
  background: var(--mp-paper);
  box-shadow: none;
}

body.mobile-ui .topbar {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: 52px;
  min-height: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--mp-soft-line);
}

body.mobile-ui .top-actions {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  width: 52px;
  min-width: 52px;
  height: 52px;
  position: relative;
  border: 0;
}

body.mobile-ui .topbar-brand {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px 0 6px;
  border: 0;
}

body.mobile-ui .top-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.mobile-ui .topbar-brand h1,
body.mobile-ui .top-round-pill {
  color: var(--mp-ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

body.mobile-ui .top-round-pill {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.mobile-ui #dayText,
body.mobile-ui .top-news-ticker,
body.mobile-ui .mobile-top-cash {
  display: none !important;
}

body.mobile-ui .mobile-menu-btn {
  display: grid !important;
  width: 52px;
  height: 52px;
  min-height: 52px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--mp-ink);
  font-size: 25px;
  font-weight: 900;
}

body.mobile-ui .mobile-menu-card {
  top: 52px;
  left: 0;
  right: auto;
  width: min(210px, calc(100vw - 24px));
  border: 1px solid var(--mp-line);
  border-radius: 0;
  background: var(--mp-paper);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

body.mobile-ui .mini-ticker {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  height: 28px;
  min-height: 28px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--mp-faint-line);
  background: var(--mp-paper-alt);
}

body.mobile-ui .mini-ticker span {
  padding-left: 14px;
  color: var(--mp-muted);
  font-size: 10px;
  font-weight: 900;
}

body.mobile-ui .mini-ticker strong {
  min-width: 0;
  overflow: hidden;
  padding-right: 14px;
  color: #555555;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui #roundProgress,
body.mobile-ui .headline-grid,
body.mobile-ui .opportunity-strip,
body.mobile-ui .thumb-action-dock,
body.mobile-ui .mobile-tabs,
body.mobile-ui .market-news,
body.mobile-ui #bottomSection,
body.mobile-ui #logsSection,
body.mobile-ui #opsPanel,
body.mobile-ui #newGameBtnTop,
body.mobile-ui #rankBtnTop,
body.mobile-ui .score,
body.mobile-ui .online-status,
body.mobile-ui .avatar-btn,
body.mobile-ui #miniItemsCard,
body.mobile-ui #quickTravelBtn,
body.mobile-ui #quickExpandBtn,
body.mobile-ui #mobileStatusStrip > .mini-stat:not(:first-child) {
  display: none !important;
}

body.mobile-ui .mobile-status-strip {
  display: grid !important;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 78px;
  height: 78px;
  min-height: 78px;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--mp-soft-line);
}

body.mobile-ui #mobileStatusStrip > .mini-stat:first-child,
body.mobile-ui #miniDebtCard,
body.mobile-ui #mobileStatusStrip > #miniDebtCard {
  display: grid !important;
  align-content: center;
  height: 78px;
  min-height: 78px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: var(--mp-paper);
  box-shadow: none;
  text-align: left;
}

body.mobile-ui #mobileStatusStrip > .mini-stat:first-child {
  grid-column: 1;
  border-right: 1px solid var(--mp-soft-line);
}

body.mobile-ui #miniDebtCard {
  grid-column: 2;
  cursor: pointer;
}

body.mobile-ui #mobileStatusStrip > #miniDebtCard {
  grid-column: 2;
}

body.mobile-ui .mini-stat span,
body.mobile-ui .mini-stat-btn span {
  color: var(--mp-muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui #mobileStatusStrip > .mini-stat:first-child strong {
  margin-top: 9px;
  color: var(--mp-ink);
  font-family: "DIN Alternate", "Avenir Next Condensed", "SF Pro Display", Helvetica, Arial, sans-serif;
  font-size: clamp(34px, 10.8vw, 38px);
  font-weight: 900;
  line-height: 0.9;
}

body.mobile-ui #miniDebtCard strong {
  margin-top: 8px;
  color: var(--mp-red);
  font-family: "DIN Alternate", "Avenir Next Condensed", "SF Pro Display", Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui .place-dock {
  height: 72px;
  min-height: 72px;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--mp-soft-line);
}

body.mobile-ui .place-dock-head {
  display: none !important;
}

body.mobile-ui .place-dock-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 36px;
  height: 72px;
}

body.mobile-ui .place-dock-item,
body.mobile-ui .place-dock-item:nth-child(4n),
body.mobile-ui .place-dock-item:nth-child(6n) {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  padding: 0 4px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--mp-faint-line);
  border-bottom: 1px solid var(--mp-faint-line);
  border-radius: 0;
  box-shadow: none;
}

body.mobile-ui .place-dock-item:nth-child(6n) {
  border-right: 0;
}

body.mobile-ui .place-dock-item span {
  display: block;
  min-width: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.08;
  overflow: hidden;
  text-align: center;
  white-space: normal;
}

body.mobile-ui .place-dock-item.district-xihu { background: #f3f5f1; color: #1f8a52; }
body.mobile-ui .place-dock-item.district-shangcheng { background: #f7f3ea; color: #d08328; }
body.mobile-ui .place-dock-item.district-gongshu { background: #f1f5f7; color: #2976b8; }
body.mobile-ui .place-dock-item.district-binjiang { background: #f4f2f8; color: #7355c8; }
body.mobile-ui .place-dock-item.district-yuhang { background: #eff6f3; color: #1aa18e; }
body.mobile-ui .place-dock-item.district-xiaoshan { background: #f8f1f4; color: #c03d78; }
body.mobile-ui .place-dock-item.active {
  background: linear-gradient(135deg, #222323, #3c3d3d 48%, #2c2d2d 50%, #171818);
  color: var(--mp-paper);
}

body.mobile-ui.mobile-view-trade #tradeSection,
body.mobile-ui .trade-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "market inv";
  min-height: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--mp-soft-line);
}

body.mobile-ui #marketPanel,
body.mobile-ui #invPanel {
  display: flex !important;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--mp-paper);
}

body.mobile-ui #marketPanel {
  grid-area: market;
  border-right: 1px solid var(--mp-line);
  background: var(--mp-paper-alt);
}

body.mobile-ui #invPanel {
  grid-area: inv;
}

body.mobile-ui #marketPanel .panel-head,
body.mobile-ui #invPanel .warehouse-head {
  display: flex;
  align-items: center;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: inherit;
}

body.mobile-ui #marketPanel h2,
body.mobile-ui #invPanel h2 {
  color: var(--mp-ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui #rumorBtn {
  display: none;
}

body.mobile-ui .capacity-chip {
  width: 62px;
  min-width: 62px;
  height: 23px;
  padding: 0;
  border: 1px solid var(--mp-soft-line);
  border-radius: 999px;
  background: var(--mp-paper);
  color: var(--mp-ink);
  font-size: 10px;
  font-weight: 900;
}

body.mobile-ui #marketPanel .panel-note,
body.mobile-ui #invPanel .inv-summary {
  display: none !important;
}

body.mobile-ui .table-scroll,
body.mobile-ui #marketPanel .table-scroll,
body.mobile-ui #invPanel .table-scroll,
body.mobile-ui.mobile-view-trade #marketPanel .table-scroll,
body.mobile-ui.mobile-view-trade #invPanel .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: inherit;
}

body.mobile-ui table,
body.mobile-ui .table-scroll table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

body.mobile-ui thead {
  height: 30px;
}

body.mobile-ui th {
  height: 30px;
  padding: 0 10px;
  border: 0;
  color: var(--mp-muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 30px;
  text-align: left;
  background: inherit;
}

body.mobile-ui td {
  height: 35px;
  padding: 0 10px;
  border: 0;
  color: var(--mp-ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 35px;
  background: inherit;
  vertical-align: middle;
}

body.mobile-ui #marketTable th:nth-child(1),
body.mobile-ui #marketTable td:nth-child(1) {
  width: 62%;
}

body.mobile-ui #marketTable th:nth-child(2),
body.mobile-ui #marketTable td:nth-child(2) {
  width: 38%;
  text-align: right;
}

body.mobile-ui #invTable th:nth-child(1),
body.mobile-ui #invTable td:nth-child(1) {
  width: 46%;
}

body.mobile-ui #invTable th:nth-child(2),
body.mobile-ui #invTable td:nth-child(2) {
  width: 24%;
  text-align: right;
}

body.mobile-ui #invTable th:nth-child(3),
body.mobile-ui #invTable td:nth-child(3) {
  width: 30%;
  text-align: right;
}

body.mobile-ui td span,
body.mobile-ui td strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui td strong {
  font: 800 12px "DIN Alternate", "Avenir Next Condensed", "SF Pro Display", Helvetica, Arial, sans-serif;
}

body.mobile-ui td .price-tag,
body.mobile-ui td .deal-badge {
  display: none !important;
}

body.mobile-ui tr.selected {
  background: transparent;
}

body.mobile-ui tr.selected td {
  box-shadow: inset 0 -3px 0 var(--mp-accent);
}

body.mobile-ui #invTable .empty-row td {
  height: 70px;
  color: #aaaaaa;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

body.mobile-ui .mobile-trade-dock,
body.mobile-ui .mobile-trade-dock.is-disabled {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-areas:
    "info info info max max max"
    "stepper stepper stepper primary primary primary";
  align-self: end;
  width: calc(100% - 48px);
  max-width: none;
  height: 116px;
  min-height: 116px;
  margin: 10px 24px 24px;
  padding: 0;
  overflow: hidden;
  transform: none;
  border: 1px solid var(--mp-faint-line);
  border-radius: 22px;
  background: var(--mp-bg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}

body.mobile-ui .mobile-trade-info,
body.mobile-ui .mobile-trade-dock.is-disabled .mobile-trade-info {
  grid-area: info;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  min-height: 68px;
  padding: 0 14px;
  gap: 5px 8px;
  border-right: 1px solid var(--mp-soft-line);
  border-bottom: 1px solid var(--mp-soft-line);
  background: var(--mp-bg);
}

body.mobile-ui .mobile-trade-info span {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--mp-muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui .mobile-trade-info strong {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--mp-ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui .mobile-trade-info small {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  overflow: hidden;
  color: var(--mp-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-ui .mobile-trade-actions {
  display: contents;
}

body.mobile-ui #mobileTradeMaxBtn,
body.mobile-ui .mobile-trade-dock.is-disabled #mobileTradeMaxBtn {
  grid-area: max;
  display: grid !important;
  place-items: center;
  align-content: center;
  min-height: 68px;
  border: 0;
  border-bottom: 1px solid var(--mp-soft-line);
  border-radius: 0;
  background: var(--mp-accent);
  color: var(--mp-paper);
  padding: 0 8px;
}

body.mobile-ui #mobileTradeMaxBtn span {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui #mobileTradeMaxBtn strong {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

body.mobile-ui .mobile-trade-stepper,
body.mobile-ui .mobile-trade-dock.is-disabled .mobile-trade-stepper {
  grid-area: stepper;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--mp-soft-line);
  border-radius: 0;
  background: var(--mp-bg);
}

body.mobile-ui .mobile-trade-stepper button,
body.mobile-ui .mobile-trade-stepper input {
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--mp-faint-line);
  border-radius: 0;
  background: var(--mp-bg);
  color: var(--mp-ink);
  font-size: 25px;
  font-weight: 900;
  text-align: center;
}

body.mobile-ui .mobile-trade-stepper button:last-child {
  border-right: 0;
}

body.mobile-ui #mobileTradePrimaryBtn,
body.mobile-ui .mobile-trade-dock.is-disabled #mobileTradePrimaryBtn {
  grid-area: primary;
  display: block !important;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: var(--mp-cold);
  color: var(--mp-paper);
  font-size: 22px;
  font-weight: 900;
}

body.mobile-ui .mobile-trade-dock.is-disabled #mobileTradePrimaryBtn,
body.mobile-ui .mobile-trade-dock.is-disabled #mobileTradeMaxBtn,
body.mobile-ui .mobile-trade-dock.is-disabled .mobile-trade-stepper {
  opacity: 0.55;
}

@media (max-width: 360px) {
  body.mobile-ui .app {
    grid-template-rows: 52px 28px 76px 72px minmax(0, 1fr) 146px;
  }

  body.mobile-ui .topbar-brand h1,
  body.mobile-ui .top-round-pill {
    font-size: 19px;
  }

  body.mobile-ui .top-title-row {
    gap: 8px;
  }

  body.mobile-ui .place-dock-item span,
  body.mobile-ui td,
  body.mobile-ui td strong {
    font-size: 11px;
  }

  body.mobile-ui .mobile-trade-dock,
  body.mobile-ui .mobile-trade-dock.is-disabled {
    width: calc(100% - 32px);
    margin: 10px 16px 20px;
  }
}
