.twb-page {
  --sa-topbar-max-width: 1280px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family-base);
}

.twb-top-link,
.twb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--card-bg);
  color: var(--primary-color);
  text-decoration: none;
  font-size: var(--font-size-xs);
  font-weight: 700;
  cursor: pointer;
}

.twb-btn--primary {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: #fff;
}

.twb-shell {
  padding-top: 16px;
  padding-bottom: 40px;
}

.twb-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.twb-eyebrow {
  display: block;
  color: var(--primary-color);
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.twb-toolbar-meta strong {
  display: block;
  margin-top: 4px;
  font-size: var(--font-size-lg);
}

.twb-hint {
  display: block;
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
}

.twb-toolbar-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.twb-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.twb-loading-host {
  min-height: 120px;
}

.twb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
}

.twb-panel {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg, 12px);
  background: var(--card-bg);
  min-width: 0;
  overflow: hidden;
}

.twb-panel--watchlist {
  grid-row: span 2;
}

.twb-panel--strategy {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--primary-color) 30%, var(--border-color));
}

.twb-panel-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.twb-strategy-layout { display: grid; gap: 12px; }

.twb-strategy-lead {
  padding: 13px 14px;
  border-radius: 10px;
  background: var(--primary-light, rgba(26, 86, 167, .06));
  border-left: 4px solid var(--primary-color);
}

.twb-strategy-lead.is-attack { border-left-color: #dc2626; background: rgba(220, 38, 38, .06); }
.twb-strategy-lead.is-defense { border-left-color: #2563eb; background: rgba(37, 99, 235, .06); }
.twb-strategy-mode { display: block; color: var(--primary-color); font-size: var(--font-size-xs); font-weight: 800; }
.twb-strategy-lead.is-attack .twb-strategy-mode { color: #dc2626; }
.twb-strategy-lead.is-defense .twb-strategy-mode { color: #2563eb; }
.twb-strategy-lead strong { display: block; margin-top: 4px; font-size: var(--font-size-base); }
.twb-strategy-lead p, .twb-strategy-disclaimer { margin: 5px 0 0; color: var(--text-secondary); font-size: var(--font-size-xs); line-height: 1.55; }

.twb-strategy-policy, .twb-score-row { display: flex; flex-wrap: wrap; gap: 8px; }
.twb-strategy-policy span, .twb-score {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
}
.twb-strategy-policy b, .twb-score strong { color: var(--text-primary); font-family: var(--font-family-number); }
.twb-evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.twb-evidence li { padding: 7px 9px; border-radius: 7px; background: var(--bg-color); color: var(--text-secondary); font-size: var(--font-size-xs); }
.twb-evidence li.is-strong { color: #15803d; }
.twb-evidence li.is-risk { color: #b91c1c; }

.twb-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light, var(--border-color));
}

.twb-panel-head h2 {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: 800;
}

.twb-panel-status {
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: 700;
  white-space: nowrap;
}

.twb-panel-status.is-error {
  color: #b91c1c;
}

.twb-panel-status.is-ok {
  color: #15803d;
}

.twb-panel-body {
  padding: 10px 12px 14px;
}

.twb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.twb-table th,
.twb-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-light, #eef2f7);
  text-align: left;
  vertical-align: middle;
}

.twb-table th {
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.twb-table tbody tr {
  cursor: pointer;
}

.twb-table tbody tr:hover {
  background: var(--primary-light, rgba(26, 86, 167, 0.06));
}

.twb-code {
  font-family: var(--font-family-number);
  font-weight: 700;
  color: var(--primary-color);
}

.twb-up { color: #dc2626; font-weight: 700; }
.twb-down { color: #16a34a; font-weight: 700; }
.twb-flat { color: var(--text-secondary); }

.twb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.twb-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light, #eef2f7);
}

.twb-list li:last-child {
  border-bottom: 0;
}

.twb-list-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.twb-list-meta {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
}

.twb-empty,
.twb-error {
  padding: 18px 8px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.55;
}

.twb-error {
  color: #b91c1c;
}

.twb-retry {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--primary-color);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

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

  .twb-panel--watchlist {
    grid-row: auto;
  }

  .twb-evidence { grid-template-columns: 1fr; }
}
