:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --bg-deep: #ede6d9;
  --surface: #fffdf9;
  --surface-raised: #ffffff;
  --surface-muted: #f4efe5;
  --surface-warm: #f8f3e9;
  --ink: #24211b;
  --ink-soft: #514a3f;
  --muted: #81796b;
  --dim: #a29a8d;
  --line: #e8e0d3;
  --line-strong: #d8cbb7;
  --gold: #aa8047;
  --gold-strong: #815c2d;
  --gold-soft: #eee3cf;
  --up: #c84e55;
  --down: #238663;
  --flat: #8a8377;
  --danger: #b64a50;
  --shadow-sm: 0 8px 24px rgba(75, 61, 37, 0.06);
  --shadow-md: 0 20px 60px rgba(75, 61, 37, 0.09);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --numeric: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", Consolas, monospace;
  --color-primary: #8d6635;
  --color-on-primary: #ffffff;
  --color-surface: #fffdf9;
  --color-on-surface: #24211b;
  --color-outline: #d8cbb7;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(178, 139, 79, 0.11), transparent 27rem),
    radial-gradient(circle at 92% 12%, rgba(126, 101, 62, 0.07), transparent 24rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid rgba(168, 125, 64, 0.55);
  outline-offset: 2px;
}

::selection {
  color: #fff;
  background: var(--gold-strong);
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.brand-mark {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 20%;
  background: #fff;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.eyebrow,
.section-kicker {
  color: var(--gold-strong);
  font-family: var(--numeric);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.var-button {
  font-family: inherit;
}

.button {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  box-shadow: none;
}

.button.button-large {
  width: 100%;
  min-height: 50px;
  font-size: 15px;
}

.var-button.button-primary {
  border: 1px solid #76552d;
  color: #fff;
  background: linear-gradient(135deg, #9f763e, #76542a);
  box-shadow: 0 9px 22px rgba(122, 85, 38, 0.2);
}

.var-button.button-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ad8249, #805b2d);
}

.var-button.button-primary:disabled {
  border-color: var(--line);
  color: #9b9388;
  background: #ece6dc;
  box-shadow: none;
  opacity: 1;
}

.var-button.button-danger {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(182, 74, 80, 0.24);
  border-radius: 14px;
  color: var(--danger);
  background: rgba(255, 253, 249, 0.58);
  box-shadow: none;
}

.var-button.button-danger:hover:not(:disabled) {
  border-color: rgba(182, 74, 80, 0.44);
  background: #fff7f5;
}

.var-button.button-dashed {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--gold-strong);
  background: transparent;
  box-shadow: none;
}

.var-button.button-dashed:hover {
  border-color: var(--gold);
  background: var(--surface-warm);
}

/* Login */
.auth-shell {
  display: grid;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  place-items: center;
  padding: 28px 18px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.32), transparent 55%),
    var(--bg);
}

.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.auth-glow-one {
  top: -18vw;
  left: -14vw;
  width: 44vw;
  height: 44vw;
  min-width: 320px;
  min-height: 320px;
  background: rgba(201, 165, 102, 0.12);
}

.auth-glow-two {
  right: -10vw;
  bottom: -22vw;
  width: 46vw;
  height: 46vw;
  min-width: 340px;
  min-height: 340px;
  border: 1px solid rgba(168, 125, 64, 0.1);
  background: rgba(137, 105, 60, 0.045);
}

.var-card.auth-panel {
  display: block;
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: 34px;
  border: 1px solid rgba(200, 184, 157, 0.72);
  border-radius: 28px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 28px 80px rgba(71, 56, 31, 0.12);
  backdrop-filter: blur(18px);
}

.var-card.auth-panel .var-card__content,
.var-card.settings-panel .var-card__content {
  margin: 0;
  padding: 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-mark-hero {
  width: 92px;
  height: 92px;
  flex: none;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(69, 55, 32, 0.08);
}

.auth-brand h1 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 40px;
  font-weight: 720;
  letter-spacing: 0.04em;
  line-height: 1.08;
}

.auth-intro {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.var-button.segment-button {
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
}

.var-button.segment-button.active {
  color: var(--ink);
  background: var(--surface-raised);
  box-shadow: 0 5px 14px rgba(75, 61, 37, 0.08);
}

.auth-segment {
  margin: 28px 0 24px;
}

.field {
  display: block;
  margin-bottom: 17px;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.field small {
  color: var(--dim);
  font-weight: 500;
}

.field input,
.config-input,
.config-select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-raised);
  outline: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.field input::placeholder,
.config-input::placeholder {
  color: #b0a89b;
}

.field input:focus,
.config-input:focus,
.config-select:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(168, 125, 64, 0.1);
}

.config-select option,
.config-select optgroup {
  color: var(--ink);
  background: var(--surface);
}

.form-message {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 12px;
}

/* Application shell */
.app-shell {
  width: min(100%, 1240px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 22px calc(92px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(206, 194, 173, 0.7);
  background: rgba(245, 241, 232, 0.9);
  backdrop-filter: blur(18px);
}

.topbar-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.topbar-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.brand-mark-small {
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--line);
}

.topbar-brand strong {
  flex: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 720;
  letter-spacing: 0.05em;
}

.topbar-divider {
  width: 1px;
  height: 13px;
  flex: none;
  background: var(--line-strong);
}

.topbar-account-name {
  overflow: hidden;
  max-width: 210px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-button.connection-pill {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 249, 0.72);
  box-shadow: none;
  font-size: 11px;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--flat);
  box-shadow: 0 0 0 3px rgba(138, 131, 119, 0.1);
}

.connection-pill.connecting .connection-dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(168, 125, 64, 0.12);
}

.connection-pill.online .connection-dot {
  background: var(--down);
  box-shadow: 0 0 0 3px rgba(35, 134, 99, 0.12);
}

.connection-pill.offline .connection-dot {
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(200, 78, 85, 0.12);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 22px;
}

.page-heading h1 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 720;
  letter-spacing: -0.03em;
}

/* Market */
body.market-focus {
  overflow: hidden;
  background: var(--bg-deep);
}

body.market-focus .app-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

body.market-focus .topbar {
  display: none;
}

body.market-focus #market-page.active {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  padding:
    max(12px, env(safe-area-inset-top))
    clamp(12px, 2vw, 28px)
    calc(78px + env(safe-area-inset-bottom));
}

.exchange-board {
  flex: none;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 13% -15%, rgba(194, 154, 87, 0.2), transparent 34%),
    linear-gradient(135deg, #201d18, #302b23 58%, #25211c);
  box-shadow: 0 18px 50px rgba(68, 51, 25, 0.15);
}

.exchange-board-top {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 24px;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.brand-mark-frame {
  display: grid;
  width: 64px;
  height: 64px;
  flex: none;
  place-items: center;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.board-kicker {
  margin-bottom: 2px;
  color: #d6b77b;
  font-family: var(--numeric);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.exchange-board h1 {
  color: #fffdf8;
  font-size: 36px;
  font-weight: 720;
  letter-spacing: 0.05em;
  line-height: 1.08;
}

.exchange-side {
  display: flex;
  flex: none;
  align-items: center;
  gap: 20px;
}

.exchange-live {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9b46f;
  box-shadow: 0 0 0 5px rgba(217, 180, 111, 0.1);
  animation: live-pulse 2.2s ease-out infinite;
}

.exchange-live > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.exchange-live > div span {
  color: #ead39f;
  font-family: var(--numeric);
  font-size: 30px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.exchange-live small {
  color: #bfb8ab;
  font-size: 10px;
}

.exchange-tools {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
}

.var-button.exchange-tool {
  min-height: 36px;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 11px;
  color: #e9e3da;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  font-size: 11px;
}

.var-button.exchange-tool:hover {
  border-color: rgba(217, 180, 111, 0.55);
  color: #f4dfb1;
  background: rgba(255, 255, 255, 0.07);
}

.tool-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.exchange-board-bottom {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

.exchange-legend,
.exchange-session {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #b9b2a7;
  font-size: 10px;
}

.exchange-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.exchange-legend i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.legend-up {
  background: #e5767b;
}

.legend-down {
  background: #4bb38d;
}

.legend-flat {
  background: #aaa294;
}

.exchange-session span + span {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.market-boards {
  min-width: 0;
}

body.market-focus .market-boards {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-color: #c9b9a2 transparent;
  scrollbar-width: thin;
}

.board-section {
  min-width: 0;
  margin-top: 16px;
}

.board-section-head {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 4px 9px;
}

.board-section-head > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.board-section-head h2 {
  color: var(--ink);
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.board-section-head small,
.board-note {
  color: var(--muted);
  font-size: 10px;
}

.board-index {
  color: var(--gold);
  font-family: var(--numeric);
  font-size: 10px;
  font-weight: 700;
}

.var-button.board-action {
  min-height: 30px;
  padding: 0;
  color: var(--gold-strong);
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 650;
}

.var-button.board-action:hover {
  color: var(--ink);
}

.quote-board {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.quote-board-header,
.board-row {
  display: grid;
  grid-template-columns:
    minmax(150px, 1.25fr)
    96px
    minmax(112px, 0.9fr)
    minmax(112px, 0.9fr)
    minmax(136px, 1fr)
    72px;
  align-items: center;
}

.quote-board-header {
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-warm);
  font-size: 10px;
  font-weight: 650;
}

.quote-board-header span,
.board-row > div {
  min-width: 0;
  padding: 0 14px;
}

.quote-board-header span:not(:first-child),
.board-row > div:not(:first-child) {
  border-left: 1px solid rgba(226, 216, 201, 0.72);
}

.quote-board-body:empty::after {
  display: block;
  padding: 36px 16px;
  color: var(--dim);
  content: "等待推送数据";
  font-size: 12px;
  text-align: center;
}

.board-row {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 120ms ease;
}

.board-row:nth-child(even) {
  background: #fefcf8;
}

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

.board-row:hover {
  background: var(--surface-warm);
}

.board-symbol {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-code {
  width: 20px;
  flex: none;
  color: #b2aa9d;
  font-family: var(--numeric);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.board-symbol strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-symbol-copy {
  min-width: 0;
}

.board-symbol-title {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.board-symbol small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-time,
.board-source {
  color: var(--muted);
  font-family: var(--numeric);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.board-source {
  overflow: hidden;
  font-family: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-price strong {
  display: block;
  color: var(--ink);
  font-family: var(--numeric);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.board-price span {
  display: block;
  min-height: 14px;
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--numeric);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.board-price.trend-up strong,
.board-price.trend-up span {
  color: var(--up);
}

.board-price.trend-down strong,
.board-price.trend-down span {
  color: var(--down);
}

.board-price.trend-flat strong {
  color: var(--ink);
}

.board-range strong,
.board-range span {
  display: block;
  color: var(--ink-soft);
  font-family: var(--numeric);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
}

.board-range span {
  color: var(--muted);
}

.board-status {
  text-align: center;
}

.trend-chip {
  display: inline-flex;
  min-width: 38px;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-warm);
  font-size: 9px;
  white-space: nowrap;
}

.trend-chip.trend-up {
  border-color: rgba(200, 78, 85, 0.24);
  color: var(--up);
  background: #fff5f5;
}

.trend-chip.trend-down {
  border-color: rgba(35, 134, 99, 0.22);
  color: var(--down);
  background: #f3faf7;
}

.board-empty {
  padding: 34px 16px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.trend-up {
  color: var(--up) !important;
}

.trend-down {
  color: var(--down) !important;
}

.trend-flat {
  color: var(--flat) !important;
}

/* Price settings */
.var-button.price-config-trigger {
  width: 100%;
  min-height: 58px;
  margin-top: 24px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 700;
}

.var-button.price-config-trigger .var-button__content {
  width: 100%;
  justify-content: space-between;
  gap: 14px;
}

.var-button.price-config-trigger:hover {
  border-color: #cfbfa7;
  background: var(--surface);
}

.var-button.price-config-trigger.is-open {
  border-color: #d3bd99;
  background: var(--surface-warm);
}

.price-config-trigger-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.price-config-trigger-main svg,
.price-config-trigger-arrow {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.price-config-trigger-main svg {
  color: var(--gold-strong);
}

.price-config-trigger-arrow {
  color: var(--muted);
  transition: transform 160ms ease;
}

.price-config-trigger.is-open .price-config-trigger-arrow {
  transform: rotate(180deg);
}

.price-config-section {
  margin-top: 22px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  scroll-margin-top: 90px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
  padding: 0 3px;
}

.section-heading h2 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.var-button#save-config {
  min-width: 100px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 12px;
}

.var-card.settings-panel {
  display: block;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.88);
  box-shadow: var(--shadow-sm);
}

.config-segment {
  margin-bottom: 15px;
}

.config-panel {
  display: none;
}

.config-panel.active {
  display: block;
}

.config-section-title {
  margin: 18px 3px 8px;
  color: var(--gold-strong);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.config-card {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  scroll-margin-block: 90px 120px;
}

.tech-details > summary {
  display: flex;
  min-height: 72px;
  list-style: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  cursor: pointer;
}

.tech-details > summary::-webkit-details-marker {
  display: none;
}

.tech-details > summary::marker {
  content: "";
}

.tech-details > summary:hover {
  background: var(--surface-warm);
}

.tech-details[open] {
  border-color: #d5c2a2;
}

.tech-details[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #fbf7f0;
}

.config-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
}

.config-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.detail-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.detail-toggle b {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 500;
  transition: transform 140ms ease;
}

.tech-details[open] .detail-toggle b {
  transform: rotate(180deg);
}

.config-card-content {
  padding: 14px 16px 16px;
}

.config-sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.config-side {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-warm);
}

.config-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 720;
}

.side-buy {
  color: var(--up);
}

.side-sell {
  color: var(--down);
}

.config-field {
  display: block;
  margin-top: 9px;
}

.config-field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.config-input,
.config-select {
  height: 41px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 13px;
}

.config-input {
  font-family: var(--numeric);
  font-variant-numeric: tabular-nums;
}

.formula-input {
  font-family: inherit;
}

.category-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.category-editor-bar > span,
.switch-label {
  color: var(--muted);
  font-size: 10px;
}

.category-enabled {
  color: var(--down) !important;
}

.category-disabled {
  color: var(--muted) !important;
}

.category-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.switch-label input {
  width: 15px;
  height: 15px;
  accent-color: var(--gold-strong);
}

.icon-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}

.icon-button.danger {
  color: var(--danger);
}

.category-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.7fr);
  gap: 10px;
  margin-bottom: 3px;
}

.tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-strong);
  font-size: 8px;
  font-weight: 650;
  vertical-align: 1px;
}

.empty-state {
  padding: 30px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-warm);
  font-size: 11px;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.logout-button {
  margin-top: 18px;
}

/* Navigation and feedback */
.bottom-nav {
  display: grid;
  position: fixed;
  z-index: 50;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  width: min(560px, calc(100% - 24px));
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(211, 198, 177, 0.66);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.88);
  box-shadow:
    0 14px 38px rgba(68, 52, 28, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(1.15);
  transform: translateX(-50%);
  transition: opacity 160ms ease, transform 160ms ease;
}

body.price-config-open .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 28px));
}

body.price-config-open .app-shell {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.var-button.nav-button {
  display: flex;
  position: relative;
  min-height: 48px;
  flex-direction: row;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #777064;
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.var-button.nav-button .var-button__content {
  justify-content: center;
  gap: 8px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  transition: transform 160ms ease, stroke-width 160ms ease;
}

.nav-button::after {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold);
  content: "";
  opacity: 0;
  transform: translateX(-50%) scaleX(0.45);
  transition: opacity 160ms ease, transform 160ms ease;
}

.var-button.nav-button:hover {
  color: var(--ink-soft);
  background: rgba(168, 125, 64, 0.055);
}

.var-button.nav-button.active {
  color: var(--gold-strong);
  background: rgba(170, 128, 71, 0.095);
  box-shadow: inset 0 0 0 1px rgba(170, 128, 71, 0.11);
}

.var-button.nav-button.active .nav-icon {
  stroke-width: 2;
  transform: translateY(-1px);
}

.var-button.nav-button.active::after {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

.toast {
  position: fixed;
  z-index: 100;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  max-width: calc(100% - 36px);
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 14px 40px rgba(68, 52, 28, 0.15);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 180, 111, 0.22);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(217, 180, 111, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 180, 111, 0);
  }
}

@media (max-width: 900px) {
  .quote-board-header,
  .board-row {
    grid-template-columns:
      minmax(100px, 1.05fr)
      minmax(82px, 0.88fr)
      minmax(84px, 0.9fr)
      minmax(84px, 0.9fr)
      64px;
  }

  .quote-board-header span:nth-child(5),
  .board-row .board-range {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding-right: 13px;
    padding-left: 13px;
  }

  .topbar {
    min-height: 64px;
  }

  .var-card.auth-panel {
    padding: 26px 21px;
    border-radius: 23px;
  }

  .auth-brand {
    gap: 15px;
  }

  .brand-mark-hero {
    width: 76px;
    height: 76px;
  }

  .auth-brand h1 {
    font-size: 34px;
  }

  .page-heading {
    align-items: flex-start;
    margin: 23px 0 18px;
  }

  .page-heading h1 {
    font-size: 29px;
  }

  body.market-focus #market-page.active {
    overflow-y: auto;
    padding:
      max(8px, env(safe-area-inset-top))
      10px
      calc(84px + env(safe-area-inset-bottom));
  }

  body.market-focus .market-boards {
    overflow: visible;
  }

  .exchange-board {
    border-radius: 20px;
  }

  .exchange-board-top {
    min-height: 96px;
    gap: 12px;
    padding: 14px;
  }

  .brand-lockup {
    gap: 11px;
  }

  .brand-mark-frame {
    width: 53px;
    height: 53px;
    border-radius: 15px;
  }

  .exchange-board h1 {
    font-size: 28px;
  }

  .exchange-side {
    gap: 10px;
  }

  .exchange-live > div span {
    font-size: 24px;
  }

  .exchange-live small {
    display: block;
    max-width: 38px;
    line-height: 1.2;
  }

  .exchange-tools {
    padding-left: 10px;
  }

  .var-button.exchange-tool {
    width: 35px;
    min-width: 35px;
    height: 35px;
    padding: 0;
  }

  .exchange-tool .tool-label {
    display: none;
  }

  .exchange-board-bottom {
    min-height: 34px;
    padding: 6px 14px;
  }

  .exchange-legend,
  .exchange-session {
    gap: 8px;
    font-size: 9px;
  }

  .exchange-session span:first-child {
    display: none;
  }

  .exchange-session span + span {
    padding-left: 0;
    border-left: 0;
  }

  .board-section {
    margin-top: 13px;
  }

  .board-section-head {
    min-height: 38px;
  }

  .board-section-head h2 {
    font-size: 17px;
  }

  .board-section-head small {
    display: none;
  }

  .quote-board-header,
  .board-row {
    grid-template-columns: minmax(82px, 0.95fr) minmax(86px, 1.02fr) minmax(86px, 1.02fr) 49px;
  }

  .quote-board-header span:nth-child(2),
  .quote-board-header span:nth-child(5),
  .board-row .board-time,
  .board-row .board-range,
  .category-board .board-source {
    display: none;
  }

  .quote-board-header span,
  .board-row > div {
    padding: 0 8px;
  }

  .quote-board-header {
    min-height: 34px;
    font-size: 9px;
  }

  .board-row {
    min-height: 65px;
  }

  .board-symbol {
    gap: 5px;
  }

  .board-code {
    width: 14px;
    font-size: 8px;
  }

  .board-symbol strong {
    font-size: 14px;
  }

  .board-symbol small {
    font-size: 8px;
  }

  .board-price strong {
    font-size: 21px;
  }

  .board-price span {
    font-size: 8px;
  }

  .board-status {
    padding-right: 5px !important;
    padding-left: 5px !important;
  }

  .trend-chip {
    min-width: 32px;
    padding: 2px 4px;
    font-size: 8px;
  }

  .var-button.price-config-trigger {
    margin-top: 18px;
  }

  .topbar-account-name {
    max-width: 120px;
  }

  .price-config-section {
    margin-top: 23px;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .var-button#save-config {
    min-width: 88px;
    min-height: 38px;
    padding: 0 12px;
    font-size: 11px;
  }

  .var-card.settings-panel {
    padding: 12px;
    border-radius: 20px;
  }

  .tech-details > summary {
    min-height: 66px;
    padding: 12px 13px;
  }

  .detail-toggle > span {
    display: none;
  }

  .config-card-content {
    padding: 12px 13px 14px;
  }

  .config-sides,
  .category-name-row {
    grid-template-columns: 1fr;
  }

  .config-input,
  .config-select {
    height: 43px;
  }

  .bottom-nav {
    bottom: max(9px, env(safe-area-inset-bottom));
    width: calc(100% - 20px);
    border-radius: 999px;
  }
}

@media (max-width: 420px) {
  .topbar-account-name {
    max-width: 82px;
  }

  .auth-brand h1 {
    font-size: 31px;
  }

  .auth-intro {
    max-width: 190px;
    line-height: 1.45;
  }

  .exchange-live small {
    display: none;
  }

  .quote-board-header,
  .board-row {
    grid-template-columns: minmax(76px, 0.92fr) minmax(82px, 1fr) minmax(82px, 1fr) 45px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
