:root {
  --ink: #10231f;
  --panel: rgba(18, 42, 38, 0.72);
  --line: rgba(232, 214, 160, 0.18);
  --text: #f3efe4;
  --muted: #b7c4b8;
  --accent: #e2b44b;
  --ok: #6fd3a2;
  --danger: #ef7b6a;
  --warn: #f0c36a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  background: var(--ink);
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(226, 180, 75, 0.22), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(72, 160, 140, 0.28), transparent 50%),
    linear-gradient(160deg, #0c1a17 0%, #16332d 45%, #0f241f 100%);
  z-index: -2;
  animation: drift 18s ease-in-out infinite alternate;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.04) translateY(-1.5%); }
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto 48px;
  display: grid;
  gap: 16px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  animation: rise 0.55s ease both;
}

.brand {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8a9590;
  box-shadow: 0 0 0 0 rgba(111, 211, 162, 0.4);
}

.dot.on {
  background: var(--ok);
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 211, 162, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(111, 211, 162, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 211, 162, 0); }
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  animation: rise 0.6s ease both;
}

.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4) { animation-delay: 0.15s; }
.panel:nth-child(5) { animation-delay: 0.2s; }
.panel:nth-child(6) { animation-delay: 0.25s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

h2 {
  margin: 0 0 6px;
  font-family: Syne, sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.hint, .msg {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

.grid {
  display: grid;
  gap: 12px;
}

.grid.one { grid-template-columns: 1fr; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

input:focus, select:focus {
  border-color: rgba(226, 180, 75, 0.7);
  background: rgba(0, 0, 0, 0.4);
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  padding: 10px 12px;
}

.toggle-row input {
  width: auto;
  accent-color: var(--accent);
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.state-grid.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.state-grid div {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.state-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 6px;
}

.state-grid b {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 800px) {
  .state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.summary-grid div,
.state-grid div {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.summary-grid span,
.state-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 6px;
}

.summary-grid b,
.state-grid b {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-weight: 500;
  background: rgba(0,0,0,0.22);
}

.data-table .open-cell {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
}

.ops {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
}

.tag-on {
  color: var(--ok);
  border-color: rgba(111, 211, 162, 0.45);
}

.tag-off {
  color: var(--muted);
}

.profit-pos { color: var(--ok); }
.profit-neg { color: var(--danger); }

a.link {
  color: var(--accent);
  text-decoration: none;
}

a.btn {
  display: inline-block;
  text-decoration: none;
}

@media (max-width: 800px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bet-head {
  margin-top: 18px;
}

.bet-head h3 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: 1rem;
}

.tpl-bar {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.tpl-bar .tpl-select-wrap {
  margin: 0;
}

.tpl-bar select,
.tpl-bar input {
  width: 100%;
}

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

.bet-list {
  display: grid;
  gap: 10px;
}

.bet-row {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.combo-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.combo-card .combo-head {
  border: none;
  background: transparent;
  padding: 0;
  grid-template-columns: 1fr 0.5fr 0.5fr 0.5fr 1.1fr 0.6fr 0.55fr 0.7fr auto;
}

.combo-card .combo-head .hidden {
  display: none;
}

.step-list {
  display: grid;
  gap: 8px;
  padding-left: 8px;
  border-left: 2px solid rgba(226, 180, 75, 0.35);
}

.step-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr auto;
  gap: 8px;
  align-items: end;
}

.custom-row {
  grid-template-columns: 0.9fr 0.7fr 0.7fr 1.2fr 0.7fr 0.8fr auto;
}

@media (max-width: 900px) {
  .custom-row,
  .combo-card .combo-head,
  .step-row {
    grid-template-columns: 1fr 1fr;
  }
}

.bet-row label {
  margin: 0;
}

@media (max-width: 900px) {
  .bet-row {
    grid-template-columns: 1fr 1fr;
  }
  .bet-row .btn {
    grid-column: 1 / -1;
  }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.99); }

.btn.primary {
  background: var(--accent);
  color: #1a1406;
  border-color: transparent;
  font-weight: 600;
}

.btn.danger {
  background: rgba(239, 123, 106, 0.16);
  border-color: rgba(239, 123, 106, 0.45);
  color: #ffd2ca;
}

.btn.ghost:hover {
  border-color: rgba(226, 180, 75, 0.55);
  background: rgba(226, 180, 75, 0.08);
}

.btn.tiny {
  padding: 6px 10px;
  font-size: 0.75rem;
}

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

.mono { color: var(--accent); font-size: 0.85rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.modal.hidden {
  display: none;
}

.dlg {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: dlgFade 0.18s ease both;
}

.dlg.hidden {
  display: none;
}

.dlg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 14, 12, 0.62);
  backdrop-filter: blur(6px);
}

.dlg-card {
  position: relative;
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid rgba(232, 214, 160, 0.28);
  background:
    linear-gradient(165deg, rgba(28, 54, 48, 0.96), rgba(14, 32, 28, 0.98));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  animation: dlgPop 0.22s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.dlg-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #6fd3a2);
}

.dlg.type-ok .dlg-accent {
  background: linear-gradient(90deg, #6fd3a2, #9ae7c4);
}

.dlg.type-error .dlg-accent {
  background: linear-gradient(90deg, #ef7b6a, #f0a090);
}

.dlg.type-ask .dlg-accent,
.dlg.type-warn .dlg-accent {
  background: linear-gradient(90deg, var(--accent), #f0c36a);
}

.dlg-body {
  padding: 22px 22px 18px;
}

.dlg-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 9px;
  border: 1px solid rgba(226, 180, 75, 0.35);
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dlg.type-ok .dlg-badge {
  color: var(--ok);
  border-color: rgba(111, 211, 162, 0.4);
}

.dlg.type-error .dlg-badge {
  color: #ffd2ca;
  border-color: rgba(239, 123, 106, 0.45);
}

.dlg-body h3 {
  margin: 0 0 8px;
  font-family: Syne, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dlg-body p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dlg-actions .btn {
  min-width: 88px;
}

.dlg-field {
  margin: -8px 0 18px;
}

.dlg-field.hidden {
  display: none;
}

.dlg-field input {
  width: 100%;
}

/* —— 账号列表页 —— */
.page-list .list-shell {
  width: min(1040px, calc(100% - 32px));
  gap: 22px;
}

.list-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 8px 2px 4px;
  animation: rise 0.55s ease both;
}

.list-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.list-hero .brand {
  margin: 0;
}

.list-hero .tagline {
  margin: 10px 0 0;
  max-width: 28rem;
}

.list-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.list-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  animation: rise 0.6s ease both;
  animation-delay: 0.05s;
}

.list-metrics > div {
  padding: 16px 8px 18px;
  border-right: 1px solid rgba(232, 214, 160, 0.12);
}

.list-metrics > div:last-child {
  border-right: none;
}

.list-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.list-metrics b {
  font-family: Syne, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.list-panel {
  animation-delay: 0.1s;
}

.list-panel-head {
  margin-bottom: 14px;
}

.list-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.account-list {
  display: grid;
  gap: 10px;
}

.account-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
  animation: rise 0.45s ease both;
}

.account-row:hover {
  border-color: rgba(226, 180, 75, 0.4);
  background: rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.account-row.is-running {
  border-color: rgba(111, 211, 162, 0.35);
}

.account-main {
  display: grid;
  grid-template-columns: 52px minmax(120px, 1.4fr) auto repeat(4, minmax(72px, 0.8fr));
  gap: 12px 14px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.account-id {
  font-family: Syne, sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.account-name {
  font-family: Syne, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.account-uid {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.account-status .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-status .dot {
  width: 7px;
  height: 7px;
}

.account-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  margin-bottom: 4px;
}

.account-stat b {
  font-size: 0.88rem;
  font-weight: 600;
}

.account-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.list-empty {
  margin: 8px 0 0;
}

@media (max-width: 960px) {
  .list-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-hero-actions {
    justify-content: flex-start;
  }

  .account-main {
    grid-template-columns: 44px 1fr;
    gap: 8px 12px;
  }

  .account-status,
  .account-stat {
    grid-column: 1 / -1;
  }

  .account-stat {
    display: inline-block;
    margin-right: 16px;
  }

  .account-row {
    grid-template-columns: 1fr;
  }

  .account-ops {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .list-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-metrics > div:nth-child(2) {
    border-right: none;
  }

  .list-metrics > div:nth-child(1),
  .list-metrics > div:nth-child(2) {
    border-bottom: 1px solid rgba(232, 214, 160, 0.12);
  }
}

@keyframes dlgFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dlgPop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(960px, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  margin: 0;
  box-shadow: var(--shadow);
}

.modal-head {
  margin-bottom: 8px;
}

.modal-toolbar {
  margin-bottom: 12px;
}

.inline-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.85rem;
}

.inline-label select {
  min-width: 100px;
}

.modal-table {
  flex: 1;
  min-height: 200px;
  max-height: calc(85vh - 160px);
  overflow: auto;
}

.latest-box, .log-box {
  margin: 0;
  min-height: 90px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
  line-height: 1.45;
}

.log-box { max-height: 360px; }

.log-item {
  display: grid;
  grid-template-columns: 64px 54px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}

.log-item .lv-info { color: var(--muted); }
.log-item .lv-ok { color: var(--ok); }
.log-item .lv-warn { color: var(--warn); }
.log-item .lv-error { color: var(--danger); }

@media (max-width: 800px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: start; }
  .log-item { grid-template-columns: 54px 1fr; }
  .log-item .lv { grid-column: 1 / -1; }
}

/* —— 登录页 —— */
.page-login .login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: min(420px, 100%);
  padding: 36px 32px 28px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(18, 28, 36, 0.92), rgba(10, 16, 22, 0.88));
  animation: rise 0.55s ease both;
}

.login-card .brand {
  margin: 0 0 8px;
  font-size: clamp(2.4rem, 6vw, 3.2rem);
}

.login-card .tagline {
  margin: 0 0 24px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form .btn {
  margin-top: 6px;
  width: 100%;
}

.login-form .hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
}

.user-bar {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.hidden,
.admin-only.hidden {
  display: none !important;
}

.create-panel,
.member-panel {
  width: min(520px, calc(100% - 24px));
  max-height: 85vh;
  overflow: auto;
}

.create-panel label,
.member-form label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.member-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.member-form label:last-of-type,
.member-form .btn {
  grid-column: 1 / -1;
}

.member-list {
  display: grid;
  gap: 10px;
}

.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.member-row .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 640px) {
  .member-form {
    grid-template-columns: 1fr;
  }
  .member-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* —— 模版回测 / 原预测页布局复用 —— */
.page-backtest .backtest-shell,
.page-predict .predict-shell {
  width: min(1180px, calc(100% - 32px));
  gap: 18px;
}

.bt-form-panel .grid {
  margin-top: 8px;
}

.bt-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.bt-summary .sum-note {
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .bt-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bt-day-row {
  cursor: pointer;
}

.bt-day-row:hover {
  background: rgba(226, 180, 75, 0.08);
}

.bt-day-row:focus-visible {
  outline: 1px solid rgba(226, 180, 75, 0.55);
  outline-offset: -1px;
}

.bt-trades-panel .bt-pager {
  margin-top: 12px;
  align-items: center;
  gap: 12px;
}

.bt-pager .mono {
  color: var(--muted);
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

.bt-act-wait td {
  color: var(--muted);
}

.bt-act-bet {
  background: rgba(226, 180, 75, 0.08);
}

.bt-act-settle {
  background: rgba(80, 160, 120, 0.08);
}

.bt-act-stop {
  background: rgba(180, 70, 70, 0.1);
}

.bt-note {
  max-width: 280px;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.predict-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.month-tabs,
.day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip-tab,
.day-tab,
.pick-btn {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.chip-tab {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  min-width: 108px;
  text-align: left;
}

.chip-tab b {
  font-family: Syne, sans-serif;
  font-size: 1.05rem;
}

.chip-tab span,
.day-tab span {
  color: var(--muted);
  font-size: 0.72rem;
}

.day-tab {
  display: grid;
  place-items: center;
  gap: 2px;
  width: 48px;
  height: 52px;
  padding: 6px;
}

.day-tab b {
  font-family: Syne, sans-serif;
}

.chip-tab.active,
.day-tab.active,
.pick-btn.active {
  border-color: rgba(226, 180, 75, 0.65);
  background: rgba(226, 180, 75, 0.14);
}

.chip-tab:hover,
.day-tab:hover,
.pick-btn:hover {
  transform: translateY(-1px);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-strip > div {
  padding: 12px 8px;
  border-right: 1px solid rgba(232, 214, 160, 0.12);
}

.stats-strip > div:last-child {
  border-right: none;
}

.stats-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 6px;
}

.stats-strip b {
  font-family: Syne, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.predict-table {
  max-height: 58vh;
  overflow: auto;
}

.linkish {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pred-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}

.pred-stats > div {
  padding: 8px 4px;
  border: 1px solid var(--line);
  text-align: center;
}

.pred-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  margin-bottom: 4px;
}

.pred-stats b {
  font-family: Syne, sans-serif;
}

.pred-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.pred-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.pick-btn {
  padding: 10px 8px;
  font-family: Syne, sans-serif;
  font-weight: 700;
}

.pred-list {
  display: grid;
  gap: 10px;
  max-height: 42vh;
  overflow: auto;
}

.pred-item {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.pred-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.tag-win { color: var(--ok); border-color: rgba(111, 211, 162, 0.35); }
.tag-lose { color: var(--danger); border-color: rgba(239, 123, 106, 0.35); }
.tag-pending { color: var(--warn); border-color: rgba(240, 195, 106, 0.35); }

@media (max-width: 900px) {
  .predict-layout {
    grid-template-columns: 1fr;
  }
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-strip > div:nth-child(2) {
    border-right: none;
  }
}
