:root {
  --bg: #0f1217;
  --panel: #171c24;
  --line: #2a3340;
  --text: #e8eef6;
  --muted: #8b98a8;
  --accent: #3d9cf0;
  --warn: #e6a23c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); }
.page { max-width: 1400px; margin: 0 auto; padding: 20px 16px 48px; }
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 10px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-width: 0;
}
h1 { margin: 0; font-size: 20px; font-weight: 600; white-space: nowrap; }
.update-time {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 650;
  color: #f0c14b;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.app-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid #4a5d3a;
  background:
    linear-gradient(180deg, rgba(240, 193, 75, 0.12), rgba(15, 20, 14, 0.9)),
    #141b14;
  box-shadow:
    inset 0 1px 0 rgba(240, 193, 75, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 6px 18px rgba(0, 0, 0, 0.28);
}
.app-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  color: #b7c4a8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.app-nav-link:hover {
  color: #f3f7ea;
  background: rgba(240, 193, 75, 0.1);
}
.app-nav-link.active {
  color: #1a1408;
  background: linear-gradient(180deg, #ffe08a, #f0c14b 55%, #c9962a);
  box-shadow: 0 0 0 1px rgba(240, 193, 75, 0.35), 0 4px 12px rgba(240, 193, 75, 0.28);
}
.header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.gold-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 8px;
  border: 1px solid #3a4a2e;
  border-radius: 8px;
  background: #161c14;
  white-space: nowrap;
}
.gold-card-label {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(240, 193, 75, 0.14);
  color: #f0c14b;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.06em;
  writing-mode: horizontal-tb;
  line-height: 1.2;
}
.gold-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: #d8e4f2;
  font-variant-numeric: tabular-nums;
}
.gold-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.gold-row .g-tag {
  flex: 0 0 auto;
  min-width: 2.5em;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.gold-row .g-main {
  color: #f0c14b;
  font-weight: 700;
}
.gold-row .g-line { color: #e8eef6; }
.gold-row .g-ago {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
}
.gold-card a {
  color: #8ec5f5;
  text-decoration: none;
}
.gold-card a:hover { text-decoration: underline; }
.gold-card .g-empty { color: var(--muted); white-space: normal; }
#btnRefresh,
.btn-refresh {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}
.btn-refresh:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(61, 156, 240, 0.28);
}
.btn-refresh:active:not(:disabled) {
  transform: translateY(0);
}
.btn-refresh.is-refreshing {
  background: linear-gradient(120deg, #2f7fbf, #3d9cf0 40%, #6ec0ff 55%, #3d9cf0 70%, #2f7fbf);
  background-size: 220% 100%;
  animation: refreshBtnShine 1.2s linear infinite;
  box-shadow: 0 0 0 1px rgba(110, 192, 255, 0.35), 0 8px 20px rgba(61, 156, 240, 0.25);
  opacity: 1;
  cursor: wait;
}
.btn-refresh.is-refreshing:disabled { opacity: 1; }
.btn-spin {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(6, 16, 24, 0.25);
  border-top-color: #061018;
  border-radius: 50%;
  animation: refreshSpin .7s linear infinite;
  flex: 0 0 auto;
}
@keyframes refreshSpin {
  to { transform: rotate(360deg); }
}
@keyframes refreshBtnShine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.refresh-strip {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #2a3a4d;
  border-radius: 10px;
  background: linear-gradient(180deg, #171e28, #121820);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.refresh-strip[hidden] { display: none !important; }
.refresh-strip-track {
  height: 6px;
  border-radius: 999px;
  background: #1c2633;
  overflow: hidden;
}
.refresh-strip-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d9cf0, #7dd3fc);
  box-shadow: 0 0 12px rgba(61, 156, 240, 0.45);
  transition: none;
}
.refresh-strip.is-indeterminate .refresh-strip-fill {
  width: 36% !important;
  animation: refreshIndeterminate 1.1s ease-in-out infinite;
}
@keyframes refreshIndeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.refresh-strip-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #9eb0c3;
  font-variant-numeric: tabular-nums;
}
.refresh-strip-text { color: #d7e6f5; font-weight: 650; }
.refresh-strip.is-done {
  border-color: rgba(46, 204, 113, 0.35);
}
.refresh-strip.is-done .refresh-strip-fill {
  background: linear-gradient(90deg, #2ecc71, #7dffa8);
  width: 100% !important;
  animation: none;
  transform: none;
}
.refresh-strip.is-done .refresh-strip-text { color: #7dffa8; }
.refresh-strip.is-err {
  border-color: rgba(231, 76, 60, 0.4);
}
.refresh-strip.is-err .refresh-strip-text { color: #ffb0a8; }
button, .tab {
  background: var(--accent);
  color: #061018;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}
.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 10px 16px;
  font-size: 14px;
}
.tab.active {
  background: var(--accent);
  color: #061018;
  border-color: var(--accent);
}
button:disabled { opacity: 0.5; }
.status {
  margin: 0 0 2px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
}
.banner {
  background: #2a2114;
  border: 1px solid var(--warn);
  color: #f3e6c8;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.banner code { color: #fff; }
.card-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.card-actions {
  position: static;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.btn-today {
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  padding: 0 10px;
  cursor: pointer;
}
.btn-today:hover,
.btn-today.active {
  border-color: #f0c14b;
  color: #f0c14b;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
  margin-bottom: 16px;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #12171f;
}
/* .seg 的 display 会盖掉 UA 的 [hidden]，放大普通物品时日线/周线会漏出来 */
.seg[hidden] {
  display: none !important;
}
.seg-btn {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 650;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active {
  background: rgba(61, 156, 240, 0.18);
  color: #d7ebff;
}
.seg-btn:hover { color: var(--text); }

.token-intro {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 16px;
  margin-top: 16px;
  margin-bottom: 0;
}
.token-intro-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.token-intro-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.token-intro-src {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.token-intro-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.token-intro-body article + article {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.token-intro-body h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 650;
  color: #f0c14b;
}
.token-intro-body h4 {
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 650;
  color: #d7ebff;
}
.token-intro-body h4:first-of-type { margin-top: 0; }
.token-intro-body p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #c9d4e0;
}
.token-intro-body p:last-child { margin-bottom: 0; }
.token-intro-body strong { color: #e8eef6; font-weight: 650; }
.card-actions .seg { height: 28px; }
.card-actions .seg-btn { padding: 0 10px; height: 28px; font-size: 12px; }

.hot-board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.hot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.hot-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.hot-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.hot-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hot-chart-wrap {
  position: relative;
  padding: 8px 12px 12px;
  min-height: 280px;
}
.hot-chart-wrap canvas {
  width: 100% !important;
  max-height: none;
}
.hot-empty {
  margin: 0;
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.hot-empty[hidden] { display: none; }
.tip-bubble {
  position: fixed;
  z-index: 2000;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(240, 193, 75, 0.45);
  background: rgba(15, 18, 23, 0.96);
  color: #e8eef6;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.tip-bubble[hidden] { display: none !important; }
.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px !important;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.card.card-full {
  grid-column: 1 / -1;
}
.card.card-full .chart-wrap {
  height: 380px;
}
.card.card-full .card-body canvas {
  max-height: 380px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  position: relative;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.price {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}
.card-body {
  padding: 8px 10px 12px;
  flex: 1;
  position: relative;
}
.chart-wrap { height: 260px; }
.btn-zoom {
  position: static;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-zoom:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.card-body canvas { width: 100% !important; max-height: 260px; }
.card-foot {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 24px 8px;
  text-align: center;
}

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1180px, 96vw);
  max-height: 92vh;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}
.modal-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-body {
  padding: 12px 16px 8px;
  height: min(620px, 68vh);
}
.modal-body canvas { width: 100% !important; height: 100% !important; }
.modal-foot {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

/* —— 页面切换 —— */
.view-stack { position: relative; min-height: 200px; }
.view-pane[hidden] { display: none !important; }
.view-pane.active {
  animation: viewIn 0.28s ease both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* —— 持仓分析 —— */
.pf-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.pf-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.pf-stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.pf-stat-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.pf-stat-value small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}
.pf-stat.pf-up .pf-stat-value { color: #e74c3c; }
.pf-stat.pf-down .pf-stat-value { color: #2ecc71; }
.pf-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 16px;
  margin-bottom: 14px;
}
.pf-panel-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 650;
}
.pf-panel-head-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.pf-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.pf-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.9fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.pf-form label,
.pf-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.pf-form input,
.pf-form select,
.pf-edit-form input {
  height: 36px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0f1217;
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}
.pf-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pf-btn-primary,
.pf-btn-ghost {
  height: 36px;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
}
.pf-btn-primary {
  background: var(--accent);
  color: #061018;
  border: 0;
}
.pf-btn-primary:disabled,
.pf-btn-ghost:disabled { opacity: 0.55; cursor: wait; }
.pf-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.pf-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.pf-table-wrap {
  overflow-x: auto;
  overflow-anchor: none;
}
.pf-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pf-col-exp { width: 44px; }
.pf-col-lots { width: 56px; }
.pf-col-name { width: 24%; }
.pf-col-num { width: 10%; }
.pf-col-qty { width: 8%; }
.pf-col-hold { width: 10%; }
.pf-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-table td {
  padding: 10px;
  border-bottom: 1px solid #222a35;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-group > td { border-bottom: 1px solid #222a35; }
.pf-group.open > td { border-bottom-color: transparent; }
.pf-detail > td {
  padding: 0 0 8px;
  border-bottom: 1px solid #222a35;
  background: transparent;
  overflow: visible;
}
.pf-detail[hidden] { display: none; }
.pf-lot-list {
  display: grid;
  gap: 6px;
  margin: 0 0 0 44px;
  padding: 8px 10px;
  border: 1px solid #243042;
  border-radius: 8px;
  background: #12171f;
}
.pf-lot-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) repeat(6, minmax(64px, 1fr)) 112px;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-top: 1px solid #1c2430;
  font-size: 12px;
}
.pf-lot-row:first-child { border-top: 0; }
.pf-name { font-weight: 650; }
.pf-item-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 2px 8px 2px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    color .15s ease,
    background .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    transform .15s ease;
}
.pf-item-link .pf-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-item-ico {
  flex: 0 0 auto;
  font-size: 12px;
  color: #c9a227;
  opacity: 0.55;
  transform: translateY(-0.5px);
  transition: opacity .15s ease, transform .15s ease, color .15s ease;
}
.pf-item-link:hover {
  color: #ffe08a;
  background: rgba(240, 193, 75, 0.1);
  border-color: rgba(240, 193, 75, 0.35);
  box-shadow: 0 0 0 1px rgba(240, 193, 75, 0.12), 0 4px 14px rgba(0, 0, 0, 0.22);
}
.pf-item-link:hover .pf-item-ico {
  opacity: 1;
  color: #f0c14b;
  transform: translate(1px, -2px);
}
.pf-item-link:active,
.pf-item-link.is-press {
  transform: scale(0.97);
  background: rgba(240, 193, 75, 0.18);
  border-color: rgba(240, 193, 75, 0.55);
}
.pf-item-link:focus-visible {
  outline: 2px solid rgba(240, 193, 75, 0.65);
  outline-offset: 2px;
}
.pf-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pf-up { color: #e74c3c; font-weight: 650; }
.pf-down { color: #2ecc71; font-weight: 650; }
.pf-flat { color: var(--muted); }
.pf-empty { text-align: center; color: var(--muted); padding: 28px 10px !important; }
.pf-expand {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.pf-expand:hover { border-color: var(--accent); color: var(--accent); }
.pf-actions {
  white-space: nowrap;
  justify-self: end;
}
.pf-act {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #1a2230;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  margin-left: 4px;
}
.pf-act:first-child { margin-left: 0; }
.pf-act:hover { border-color: var(--accent); color: #9fd0ff; }
.pf-act.danger:hover { border-color: #e74c3c; color: #ff8f8f; background: #2a1818; }
.pf-footnote {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.pf-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  min-width: 160px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  background: #1c2430;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.pf-toast.show { opacity: 1; transform: none; }
.pf-toast.ok { border-color: rgba(61,156,240,.45); }
.pf-toast.err { border-color: rgba(231,76,60,.55); color: #ffc9c4; }
.pf-modal[hidden] { display: none !important; }
.pf-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
}
.pf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.pf-modal-panel {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px 18px;
}
.pf-modal-panel h3 { margin: 0 0 12px; font-size: 16px; }
.pf-edit-form {
  display: grid;
  gap: 10px;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .header { flex-direction: column; align-items: stretch; }
  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
  }
  .pf-lot-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
  }
  .pf-actions { justify-self: start; }
  .gold-card {
    flex: 1 1 auto;
    white-space: normal;
  }
  .gold-card-body { white-space: normal; }
  .gold-row { flex-wrap: wrap; }
  #btnRefresh { height: 36px; }
  .modal-body { height: min(420px, 58vh); }
  .header-brand { width: 100%; }
  .app-nav { width: 100%; overflow-x: auto; }
  .app-nav-link { flex: 0 0 auto; }
  .pf-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-form { grid-template-columns: 1fr 1fr; }
  .pf-note { grid-column: 1 / -1; }
  .pf-form-actions { grid-column: 1 / -1; }
}
