:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #eef3ef;
  color: #14241e;
}

.commercial-account-panel {
  margin-bottom: 18px;
}

.commercial-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin: 0 14px 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.commercial-account-grid > section {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.commercial-account-grid h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.commercial-account-grid .security-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.commercial-account-grid .security-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 0;
}

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

@media (max-width: 620px) {
  .commercial-account-grid {
    grid-template-columns: 1fr;
    margin-right: 10px;
    margin-left: 10px;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(19, 111, 67, 0.08), rgba(238, 243, 239, 0) 260px),
    #eef3ef;
}

body.auth-pending > .shell,
body.auth-pending > .commercial-shell,
body.auth-pending > .mobile-workspace-nav,
body.auth-pending > .comparison-modal {
  visibility: hidden;
}

body.modal-open {
  overflow: hidden;
}

.shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: #47725f;
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
  color: #0c2118;
}

h2 {
  font-size: 18px;
}

.search {
  display: flex;
  gap: 10px;
  min-width: min(520px, 100%);
}

input,
select,
button {
  height: 44px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #b9c9c0;
  padding: 0 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(20, 36, 30, 0.04);
}

button {
  border: 0;
  padding: 0 18px;
  background: #0f6b46;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 107, 70, 0.18);
}

button:disabled {
  background: #8aa296;
  cursor: wait;
}

.freshness-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.freshness-bar > div,
.auto-refresh,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border: 1px solid #d4dfd8;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 48, 38, 0.05);
}

.secondary-button {
  justify-content: center;
  color: #0f6b46;
  background: #f8fbf9;
  box-shadow: 0 8px 24px rgba(24, 48, 38, 0.05);
}

.freshness-bar span {
  color: #62736b;
  font-size: 13px;
}

.freshness-bar strong {
  color: #0e5f3d;
}

.auto-refresh {
  justify-content: flex-start;
  cursor: pointer;
}

.auto-refresh input {
  width: 18px;
  height: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.alerts {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.alert-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #a9d7ba;
  border-radius: 8px;
  padding: 14px 16px;
  background: #f3fbf5;
  color: #123b28;
  box-shadow: 0 8px 24px rgba(24, 48, 38, 0.05);
}

.alert-card.muted {
  border-color: #e1d2a5;
  background: #fff9e8;
  color: #66501e;
}

.alert-card span {
  color: inherit;
  font-size: 13px;
}

.metrics article,
.panel {
  border: 1px solid #d4dfd8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 48, 38, 0.06);
}

.metrics article {
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f9fbf9);
}

.metrics span {
  display: block;
  color: #62736b;
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  color: #0e5f3d;
}

.manual-panel {
  margin-bottom: 16px;
}

.manual-form {
  display: grid;
  grid-template-columns: 100px 1.3fr 140px 90px 110px 100px 90px 1fr 120px;
  gap: 10px;
  padding: 16px;
}

.manual-status {
  min-height: 22px;
  padding: 0 16px 16px;
  font-size: 13px;
}

.manual-status.is-ok {
  color: #08713e;
}

.manual-status.is-error {
  color: #a52720;
}

.grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 16px;
  margin-bottom: 16px;
}

.product-pool {
  margin-bottom: 16px;
}

.product-form {
  display: grid;
  grid-template-columns: 1.3fr 130px 110px 1fr 90px 110px 110px 90px 1.3fr 120px;
  gap: 10px;
  padding: 16px 16px 0;
}

.source-platforms-panel,
.data-sources-panel {
  margin-bottom: 16px;
}

.focus-panel {
  margin-bottom: 16px;
}

.focus-strategy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.opportunity-buckets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 16px 0;
}

.opportunity-buckets article {
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.opportunity-buckets span {
  display: block;
  color: #607168;
  font-size: 13px;
}

.opportunity-buckets strong {
  display: block;
  margin-top: 6px;
  color: #0e5f3d;
  font-size: 24px;
}

.strategy-block {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.strategy-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf1ee;
  padding-bottom: 8px;
}

.strategy-title strong {
  font-size: 16px;
}

.strategy-title span {
  color: #607168;
  font-size: 13px;
}

.focus-empty {
  border: 1px dashed #d5b065;
  border-radius: 8px;
  padding: 16px;
  background: #fff8e8;
}

.focus-empty strong {
  color: #7c5000;
}

.focus-empty p {
  margin-top: 8px;
  color: #695c44;
  line-height: 1.55;
}

.focus-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 16px;
  border: 1px solid #cce5d4;
  border-radius: 8px;
  padding: 14px;
  background: #f7fcf8;
}

.focus-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.focus-card p {
  color: #607168;
}

.focus-route,
.focus-money {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.focus-money strong {
  color: #08713e;
  font-size: 18px;
}

.products {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
}

.product-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  border: 1px solid #dbe4dd;
  border-radius: 999px;
  padding: 8px 12px;
  color: #1f3129;
  text-decoration: none;
  background: #fbfcfb;
}

.product-chip strong {
  max-width: min(56vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.product-chip span {
  color: #62736b;
  font-size: 12px;
}

.product-empty {
  width: 100%;
  padding: 0;
}

.source-platforms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.data-sources {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.data-source-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.data-source-card p {
  color: #607168;
  font-size: 13px;
  line-height: 1.45;
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
  color: #14241e;
  text-decoration: none;
}

.source-card:hover {
  border-color: #92b7a3;
  box-shadow: 0 10px 22px rgba(24, 48, 38, 0.08);
}

.source-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.source-card-title strong {
  font-size: 15px;
}

.source-priority {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #eef3ef;
  color: #476258;
}

.priority-1,
.priority-2 {
  background: #e6f7ed;
  color: #08713e;
}

.priority-3 {
  background: #fff3d7;
  color: #8a5a00;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-meta span {
  border-radius: 999px;
  padding: 5px 8px;
  background: #edf5f0;
  color: #325747;
  font-size: 12px;
  font-weight: 700;
}

.source-card p {
  color: #607168;
  font-size: 13px;
  line-height: 1.45;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #edf1ee;
}

.panel-head p {
  color: #64746d;
  font-size: 13px;
}

.platforms {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.platform-card {
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.platform-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.badge {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1.35;
  background: #e9eee9;
  color: #44544d;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge.ok {
  background: #d8f4df;
  color: #116530;
}

.badge.ready {
  background: #e6f7ed;
  color: #08713e;
}

.badge.login_required,
.badge.javascript_required,
.badge.no_public_price,
.badge.missing_credentials {
  background: #fff1c7;
  color: #7a5400;
}

.badge.fetch_error {
  background: #ffe0df;
  color: #9b1c1c;
}

.platform-card p {
  margin-top: 8px;
  color: #5d6b65;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
  scrollbar-color: #90a79b #eef3ef;
  scrollbar-width: thin;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.quotes-table {
  min-width: 1060px;
}

.opportunities-table {
  min-width: 1340px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1ee;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  color: #5b6d64;
  background: #f8fbf9;
  font-weight: 700;
  white-space: nowrap;
}

td {
  color: #14241e;
}

.quotes-table th:first-child,
.quotes-table td:first-child,
.opportunities-table th:nth-child(2),
.opportunities-table td:nth-child(2),
.opportunities-table th:nth-child(3),
.opportunities-table td:nth-child(3),
.opportunities-table th:nth-child(n + 5),
.opportunities-table td:nth-child(n + 5) {
  white-space: nowrap;
}

.quotes-table th:nth-child(1),
.quotes-table td:nth-child(1) {
  width: 74px;
}

.quotes-table th:nth-child(3),
.quotes-table td:nth-child(3) {
  width: 116px;
  white-space: nowrap;
}

.quotes-table th:nth-child(4),
.quotes-table td:nth-child(4) {
  width: 82px;
  white-space: nowrap;
}

.quotes-table th:nth-child(5),
.quotes-table td:nth-child(5) {
  width: 116px;
}

.quotes-table th:nth-child(6),
.quotes-table td:nth-child(6) {
  width: 86px;
  white-space: nowrap;
}

.quotes-table th:nth-child(7),
.quotes-table td:nth-child(7) {
  width: 86px;
  white-space: nowrap;
}

.quotes-table th:nth-child(8),
.quotes-table td:nth-child(8) {
  width: 92px;
  white-space: nowrap;
}

.opportunities-table th:nth-child(1),
.opportunities-table td:nth-child(1) {
  min-width: 280px;
}

.opportunities-table th:nth-child(2),
.opportunities-table td:nth-child(2) {
  width: 116px;
}

.opportunities-table th:nth-child(3),
.opportunities-table td:nth-child(3) {
  width: 72px;
}

.opportunities-table th:nth-child(4),
.opportunities-table td:nth-child(4) {
  min-width: 170px;
}

.opportunity-row {
  background: #fff;
}

.opportunity-row:nth-child(odd) {
  background: #fbfdfb;
}

.opportunity-row.risk-低 {
  box-shadow: inset 4px 0 0 #21a66a;
}

.opportunity-row.risk-中 {
  box-shadow: inset 4px 0 0 #d89416;
}

.opportunity-row.risk-高 {
  box-shadow: inset 4px 0 0 #d54b45;
}

.platform-pill,
.route-buy,
.route-sell,
.roi-pill,
.risk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  border-radius: 999px;
  padding: 7px 9px;
  background: #edf5f0;
  color: #245741;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.platform-pill {
  min-width: 44px;
  padding: 6px 9px;
  background: #edf5f0;
  color: #245741;
  font-weight: 700;
}

.platform-link {
  text-decoration: none;
  cursor: pointer;
}

.platform-link:hover {
  outline: 2px solid rgba(15, 107, 70, 0.25);
  outline-offset: 2px;
}

.style-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  border-radius: 6px;
  padding: 5px 8px;
  background: #f2f6f4;
  color: #213a30;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.route {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.route-button {
  height: auto;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.route-button:hover {
  background: #f3f8f5;
}

.route-buy,
.route-sell {
  min-width: 48px;
  padding: 7px 10px;
  font-weight: 800;
}

.route-buy {
  background: #e7f2ff;
  color: #155b9f;
}

.route-sell {
  background: #e7f8ed;
  color: #0a6a3a;
}

.route-arrow {
  color: #71837a;
  font-weight: 800;
}

.money-cell {
  font-variant-numeric: tabular-nums;
}

.buy-price {
  color: #155b9f;
}

.sell-price,
.profit-cell {
  color: #08713e;
  font-weight: 800;
}

.roi-pill {
  min-width: 54px;
  padding: 7px 9px;
  background: #f0f7f2;
  color: #0d6c3d;
  font-weight: 800;
}

.risk-pill {
  min-width: 42px;
  padding: 7px 9px;
  font-weight: 800;
}

.risk-pill.risk-低 {
  background: #e6f7ed;
  color: #08713e;
}

.risk-pill.risk-中 {
  background: #fff3d7;
  color: #8a5a00;
}

.risk-pill.risk-高 {
  background: #ffe7e5;
  color: #a52720;
}

.risk-pill.risk-未知 {
  background: #edf1ee;
  color: #5d6b65;
}

.freshness-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.freshness-pill.fresh {
  background: #e6f7ed;
  color: #08713e;
}

.freshness-pill.stale {
  background: #ffe7e5;
  color: #a52720;
}

.freshness-pill.unknown {
  background: #edf1ee;
  color: #5d6b65;
}

.stale-row {
  opacity: 0.58;
}

.comparison-modal[hidden] {
  display: none;
}

.comparison-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.comparison-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 15, 0.38);
}

.comparison-sheet {
  position: relative;
  width: min(620px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(10, 18, 15, 0.3);
}

.comparison-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  height: 34px;
  border: 1px solid #f0c7c0;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff7f5;
  color: #c22e24;
  box-shadow: none;
  font-size: 13px;
}

.comparison-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 28px 48px 18px 24px;
}

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

.comparison-brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: #ff3f36;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
}

.comparison-brand p {
  color: #ff3f36;
  font-size: 22px;
  font-weight: 900;
}

.comparison-brand span {
  display: block;
  margin-top: 4px;
  color: #8a8f8b;
}

.comparison-open {
  flex-shrink: 0;
  border-radius: 6px;
  padding: 14px 20px;
  background: #ff4b43;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.comparison-product {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 16px;
  padding: 14px 24px 8px;
}

.shoe-thumb {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 8px;
  background: linear-gradient(145deg, #f4f5f4, #e9efeb);
  color: #a8b4ad;
  font-weight: 900;
}

.comparison-product h3 {
  margin: 2px 0 8px;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0;
}

.comparison-product p {
  color: #6c756f;
  font-size: 16px;
}

.comparison-product strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  font-weight: 500;
}

.comparison-proof {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 24px;
  border-radius: 0;
  padding: 16px 20px;
  background: #fff1f1;
}

.comparison-proof strong {
  color: #2d302e;
  font-size: 18px;
}

.comparison-proof span {
  color: #ff3f36;
  font-weight: 800;
}

.comparison-list {
  display: grid;
  gap: 0;
  padding: 18px 24px 28px;
}

.comparison-row {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  border-bottom: 1px solid #eef1ef;
  padding: 12px 14px;
  color: #202a25;
  text-decoration: none;
}

.comparison-row.is-best {
  border: 1px solid #ff7b6f;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff, #fff3f0);
}

.comparison-row.is-muted {
  color: #5f6963;
}

.comparison-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: #f04b2f;
  color: #fff;
  font-weight: 900;
  font-size: 20px;
}

.platform-天猫,
.platform-京东,
.platform-拼多多 {
  background: #e71918;
}

.platform-得物 {
  background: #11151b;
}

.platform-95分 {
  background: #0f6b46;
}

.platform-识货 {
  background: #ff3f36;
}

.comparison-platform-copy strong {
  display: block;
  font-size: 18px;
}

.comparison-platform-copy span {
  display: block;
  margin-top: 4px;
  color: #7b8780;
  font-size: 13px;
}

.comparison-price {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.comparison-price strong {
  font-size: 22px;
}

.best-price-tag {
  border-radius: 4px;
  border: 1px solid #f1a44c;
  padding: 3px 6px;
  color: #b86600;
  font-size: 12px;
  font-weight: 800;
}

.empty {
  color: #7a8780;
  text-align: center;
}

/* Liquid Glass Operations visual refresh */
:root {
  --ink: #10221b;
  --muted: #63776e;
  --line: rgba(25, 64, 49, 0.12);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --glass: rgba(255, 255, 255, 0.62);
  --graphite: #061a17;
  --graphite-2: #0b2a25;
  --green: #16a36a;
  --green-dark: #08713e;
  --blue: #246bb2;
  --amber: #d68b10;
  --red: #df4138;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% -10%, rgba(38, 171, 111, 0.18), transparent 34%),
    linear-gradient(180deg, #f5f8f5 0, #eef5f1 48%, #f8faf7 100%);
  color: var(--ink);
}

.shell {
  width: min(1480px, calc(100% - 40px));
  padding: 18px 0 34px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 14px 18px;
  background:
    linear-gradient(135deg, rgba(6, 26, 23, 0.98), rgba(8, 44, 36, 0.95)),
    var(--graphite);
  box-shadow: 0 22px 60px rgba(5, 25, 20, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28), 0 12px 26px rgba(0, 0, 0, 0.18);
}

.topbar .eyebrow {
  color: rgba(221, 245, 234, 0.78);
}

.topbar h1 {
  color: #fff;
  font-size: clamp(22px, 2.4vw, 32px);
}

.search {
  align-items: center;
  max-width: 560px;
}

.search input {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.search button,
.manual-form button,
.product-form button {
  background: linear-gradient(180deg, #1fc47d, #0b8651);
  box-shadow: 0 14px 28px rgba(10, 130, 79, 0.24);
}

.freshness-bar {
  margin-top: 14px;
}

.freshness-bar > div,
.auto-refresh,
.secondary-button,
.metrics article,
.panel,
.alert-card,
.source-card,
.data-source-card,
.platform-card,
.opportunity-buckets article,
.focus-card,
.focus-empty,
.comparison-sheet {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 50px rgba(16, 46, 36, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.freshness-bar > div,
.auto-refresh,
.secondary-button,
.metrics article,
.panel,
.alert-card {
  border-radius: 12px;
}

.freshness-bar > div,
.auto-refresh,
.secondary-button {
  min-height: 54px;
  padding: 12px 16px;
}

.freshness-bar strong,
.metrics strong,
.opportunity-buckets strong {
  color: var(--green-dark);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-dark);
}

.metrics {
  gap: 14px;
}

.metrics article {
  position: relative;
  min-height: 104px;
  padding: 18px 18px 16px;
  overflow: hidden;
}

.metrics article::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 18px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(22, 163, 106, 0.1);
}

.metrics span,
.freshness-bar span,
.panel-head p,
.source-card p,
.data-source-card p,
.platform-card p {
  color: var(--muted);
}

.metrics strong {
  font-size: 30px;
  letter-spacing: 0;
}

.alerts {
  margin-top: 2px;
}

.alert-card {
  position: relative;
  min-height: 92px;
  border-color: rgba(22, 163, 106, 0.24);
  padding: 18px 20px 18px 22px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(235, 250, 242, 0.84)),
    var(--surface-strong);
}

.alert-card::before {
  content: "当前最佳机会";
  position: absolute;
  top: -1px;
  left: -1px;
  border-radius: 12px 0 12px 0;
  padding: 8px 18px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.alert-card strong {
  margin-left: 128px;
  font-size: 20px;
}

.alert-card span {
  font-weight: 700;
}

.alert-card.muted::before {
  content: "等待机会";
  background: #d79a20;
}

.alert-card.muted {
  border-color: rgba(215, 154, 32, 0.26);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 231, 0.88));
}

.panel {
  background: var(--surface-strong);
}

.panel-head {
  padding: 18px 20px;
  border-bottom-color: rgba(25, 64, 49, 0.08);
}

.panel-head h2 {
  font-size: 17px;
  color: #12251e;
}

input,
select {
  border-color: rgba(25, 64, 49, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(22, 163, 106, 0.22);
  outline-offset: 2px;
}

.manual-form,
.product-form {
  gap: 8px;
}

.source-platforms,
.data-sources,
.platforms,
.products,
.focus-strategy,
.opportunity-buckets {
  gap: 12px;
}

.source-card,
.data-source-card,
.platform-card {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.source-meta span,
.badge,
.platform-pill,
.stock-pill,
.freshness-pill,
.source-priority,
.product-chip {
  border-radius: 999px;
}

.badge.ok,
.badge.ready,
.freshness-pill.fresh,
.risk-pill.risk-低 {
  background: rgba(22, 163, 106, 0.12);
  color: #077344;
}

.badge.missing_credentials,
.badge.no_public_price,
.badge.login_required,
.badge.javascript_required,
.risk-pill.risk-中 {
  background: rgba(214, 139, 16, 0.14);
  color: #8f5a05;
}

.badge.fetch_error,
.freshness-pill.stale,
.risk-pill.risk-高 {
  background: rgba(223, 65, 56, 0.12);
  color: #b52b24;
}

.focus-panel {
  border-color: rgba(22, 163, 106, 0.22);
}

.opportunity-buckets article {
  min-height: 92px;
  background: rgba(255, 255, 255, 0.58);
}

.opportunity-buckets strong {
  font-size: 28px;
}

.focus-card {
  border-radius: 12px;
  border-color: rgba(22, 163, 106, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 253, 249, 0.72));
}

.focus-card h3 {
  font-size: 18px;
}

.focus-money {
  flex-wrap: wrap;
}

.focus-money strong {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(22, 163, 106, 0.12);
  color: #047443;
}

.route-buy {
  background: rgba(36, 107, 178, 0.12);
  color: var(--blue);
}

.route-sell {
  background: rgba(22, 163, 106, 0.14);
  color: var(--green-dark);
}

.table-wrap {
  scrollbar-color: rgba(22, 163, 106, 0.42) rgba(240, 246, 242, 0.8);
}

table {
  background: rgba(255, 255, 255, 0.58);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 252, 249, 0.94);
  color: #51675e;
}

td {
  color: #152820;
}

tr:hover td {
  background: rgba(233, 248, 239, 0.48);
}

.opportunity-row.risk-低 {
  box-shadow: inset 5px 0 0 var(--green);
}

.opportunity-row.risk-中 {
  box-shadow: inset 5px 0 0 var(--amber);
}

.opportunity-row.risk-高 {
  box-shadow: inset 5px 0 0 var(--red);
}

.profit-cell,
.sell-price {
  color: var(--green-dark);
}

.buy-price {
  color: var(--blue);
}

.comparison-backdrop {
  background: rgba(4, 18, 15, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.comparison-sheet {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
}

.comparison-hero {
  background: linear-gradient(135deg, var(--graphite), var(--graphite-2));
}

.comparison-brand p,
.comparison-brand span {
  color: #fff;
}

.comparison-open {
  background: linear-gradient(180deg, #1fc47d, #0b8651);
}

.comparison-proof {
  background: rgba(22, 163, 106, 0.1);
}

.comparison-proof span {
  color: var(--green-dark);
}

@media (max-width: 880px) {
  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
    border-radius: 12px;
  }

  .brand-lockup {
    min-width: 0;
  }

  .grid,
  .metrics,
  .freshness-bar {
    grid-template-columns: 1fr;
  }

  .source-platforms {
    grid-template-columns: 1fr;
  }

  .data-sources,
  .opportunity-buckets {
    grid-template-columns: 1fr;
  }

  .focus-card {
    grid-template-columns: 1fr;
  }

  .focus-strategy {
    grid-template-columns: 1fr;
  }

  .comparison-modal {
    padding: 0;
    align-items: stretch;
  }

  .comparison-sheet {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .comparison-hero,
  .comparison-proof {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-product {
    grid-template-columns: 92px 1fr;
  }

  .shoe-thumb {
    width: 92px;
    height: 92px;
  }

  .comparison-row {
    grid-template-columns: 58px 1fr;
  }

  .comparison-price {
    grid-column: 2;
    justify-items: start;
  }

  .search {
    min-width: 0;
  }

  .manual-form,
  .product-form {
    grid-template-columns: 1fr;
  }

  .alert-card {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 48px;
  }

  .alert-card strong {
    margin-left: 0;
  }
}

/* Dark trading desk target, based on the supplied dashboard reference */
:root {
  color-scheme: dark;
  --desk-bg: #05090c;
  --desk-bg-2: #071116;
  --desk-panel: #0b151a;
  --desk-panel-2: #101d23;
  --desk-panel-3: #13262b;
  --desk-line: rgba(151, 190, 173, 0.15);
  --desk-line-strong: rgba(40, 210, 132, 0.28);
  --desk-text: #e8f3ee;
  --desk-muted: #8fa59b;
  --desk-dim: #5f766d;
  --desk-green: #20d283;
  --desk-green-dark: #0ea86a;
  --desk-blue: #4aa3ff;
  --desk-amber: #ffb64d;
  --desk-red: #ff5c57;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% -10%, rgba(32, 210, 131, 0.16), transparent 26%),
    radial-gradient(circle at 82% 0, rgba(74, 163, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #061116 0, var(--desk-bg) 52%, #030609 100%);
  color: var(--desk-text);
}

.shell {
  width: min(1500px, calc(100% - 28px));
  padding: 10px 0 28px;
}

.topbar {
  position: sticky;
  top: 8px;
  z-index: 20;
  align-items: center;
  border: 1px solid rgba(120, 168, 148, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(17, 31, 36, 0.96), rgba(7, 14, 18, 0.96)),
    var(--desk-panel);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-lockup {
  gap: 10px;
  min-width: 270px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(32, 210, 131, 0.32);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(32, 210, 131, 0.24), rgba(32, 210, 131, 0.08));
  color: #dffced;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 22px rgba(0, 0, 0, 0.26);
}

.topbar .eyebrow {
  margin-bottom: 4px;
  color: var(--desk-muted);
}

.topbar h1 {
  color: var(--desk-text);
  font-size: clamp(20px, 2vw, 28px);
}

.search {
  max-width: 620px;
}

input,
select,
button {
  height: 40px;
}

input,
select,
.search input {
  border: 1px solid rgba(137, 174, 158, 0.18);
  border-radius: 7px;
  background: #081217;
  color: var(--desk-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input::placeholder {
  color: rgba(232, 243, 238, 0.38);
}

button,
.search button,
.manual-form button,
.product-form button {
  border-radius: 7px;
  background: linear-gradient(180deg, #23d989, #0a8f58);
  color: #04100b;
  box-shadow: 0 10px 24px rgba(10, 143, 88, 0.25);
}

button:disabled {
  color: #c5d5cf;
  background: #2d423b;
}

.freshness-bar {
  grid-template-columns: 0.9fr 0.9fr 1.25fr 1fr;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.freshness-bar > div,
.auto-refresh,
.secondary-button,
.metrics article,
.panel,
.alert-card,
.source-card,
.data-source-card,
.platform-card,
.opportunity-buckets article,
.focus-card,
.focus-empty,
.comparison-sheet {
  border: 1px solid var(--desk-line);
  background: linear-gradient(180deg, rgba(16, 29, 35, 0.96), rgba(8, 18, 22, 0.96));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.freshness-bar > div,
.auto-refresh,
.secondary-button {
  min-height: 46px;
  border-radius: 8px;
  padding: 9px 12px;
}

.freshness-bar span,
.metrics span,
.panel-head p,
.source-card p,
.data-source-card p,
.platform-card p,
.product-chip span {
  color: var(--desk-muted);
}

.freshness-bar strong,
.metrics strong,
.opportunity-buckets strong {
  color: var(--desk-green);
}

.secondary-button {
  color: #dffced;
  background: linear-gradient(180deg, rgba(25, 44, 50, 0.96), rgba(12, 25, 30, 0.96));
  box-shadow: none;
}

.auto-refresh input {
  accent-color: var(--desk-green);
}

.alerts {
  margin: 0 0 10px;
}

.alert-card {
  min-height: 96px;
  border-radius: 9px;
  border-color: var(--desk-line-strong);
  padding: 18px 22px 18px 170px;
  background:
    linear-gradient(90deg, rgba(32, 210, 131, 0.12), rgba(16, 29, 35, 0.98) 38%, rgba(9, 19, 24, 0.98)),
    var(--desk-panel);
  color: var(--desk-text);
}

.alert-card::before {
  top: 18px;
  left: 22px;
  border-radius: 7px;
  padding: 10px 13px;
  background: rgba(32, 210, 131, 0.16);
  color: var(--desk-green);
  box-shadow: inset 0 0 0 1px rgba(32, 210, 131, 0.22);
}

.alert-card strong {
  margin-left: 0;
  color: #f1fff8;
  font-size: 20px;
}

.alert-card span {
  color: #a9bcb4;
}

.alert-card.muted {
  border-color: rgba(255, 182, 77, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 182, 77, 0.12), rgba(16, 29, 35, 0.98) 38%, rgba(9, 19, 24, 0.98)),
    var(--desk-panel);
}

.alert-card.muted::before {
  background: rgba(255, 182, 77, 0.14);
  color: var(--desk-amber);
  box-shadow: inset 0 0 0 1px rgba(255, 182, 77, 0.24);
}

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

.metrics article {
  min-height: 86px;
  border-radius: 8px;
  padding: 14px 14px 12px;
  overflow: hidden;
}

.metrics article::after {
  right: 14px;
  top: 14px;
  width: 38px;
  height: 38px;
  background: rgba(32, 210, 131, 0.1);
  box-shadow: inset 0 0 0 1px rgba(32, 210, 131, 0.14);
}

.metrics strong {
  margin-top: 7px;
  font-size: 25px;
}

.panel {
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(15, 29, 34, 0.98), rgba(8, 18, 22, 0.98));
}

.panel-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--desk-line);
}

.panel-head h2 {
  color: var(--desk-text);
  font-size: 16px;
}

.manual-panel,
.product-pool,
.source-platforms-panel,
.data-sources-panel,
.grid,
.focus-panel {
  margin-bottom: 10px;
}

.manual-form,
.product-form {
  gap: 8px;
  padding: 12px 14px;
}

.product-form {
  padding-bottom: 0;
}

.manual-status {
  color: var(--desk-muted);
  padding: 0 14px 12px;
}

.manual-status.is-ok {
  color: var(--desk-green);
}

.manual-status.is-error {
  color: var(--desk-red);
}

.grid {
  grid-template-columns: 0.72fr 1.8fr;
  gap: 10px;
}

.source-platforms,
.data-sources,
.products,
.platforms,
.opportunity-buckets,
.focus-strategy {
  gap: 10px;
  padding: 12px 14px;
}

.source-platforms {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.source-card,
.data-source-card,
.platform-card,
.opportunity-buckets article,
.focus-card,
.focus-empty {
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(19, 38, 43, 0.92), rgba(11, 22, 27, 0.92));
}

.source-card,
.data-source-card {
  min-height: 126px;
}

.source-card:hover {
  border-color: rgba(32, 210, 131, 0.36);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.source-card-title strong,
.data-source-card strong,
.platform-card strong {
  color: var(--desk-text);
}

.source-meta span,
.source-priority,
.product-chip,
.badge,
.platform-pill,
.stock-pill,
.style-code,
.route-buy,
.route-sell,
.roi-pill,
.risk-pill,
.freshness-pill {
  border: 1px solid rgba(151, 190, 173, 0.13);
  border-radius: 999px;
  background: rgba(232, 243, 238, 0.06);
  color: #c5d5cf;
}

.style-code {
  border-radius: 6px;
  color: #d7f3e4;
  font-size: 12px;
}

.badge.ok,
.badge.ready,
.priority-1,
.priority-2,
.freshness-pill.fresh,
.risk-pill.risk-低 {
  background: rgba(32, 210, 131, 0.12);
  color: var(--desk-green);
}

.badge.missing_credentials,
.badge.no_public_price,
.badge.login_required,
.badge.javascript_required,
.priority-3,
.risk-pill.risk-中 {
  background: rgba(255, 182, 77, 0.13);
  color: var(--desk-amber);
}

.badge.fetch_error,
.freshness-pill.stale,
.risk-pill.risk-高 {
  background: rgba(255, 92, 87, 0.12);
  color: var(--desk-red);
}

.platform-pill,
.stock-pill {
  color: #d8ece4;
}

.product-chip {
  color: var(--desk-text);
  background: rgba(18, 38, 43, 0.9);
  text-decoration: none;
}

.opportunity-buckets {
  padding-bottom: 0;
}

.opportunity-buckets article {
  min-height: 74px;
  padding: 11px 12px;
}

.opportunity-buckets strong {
  font-size: 25px;
}

.strategy-title {
  border-bottom: 1px solid var(--desk-line);
}

.strategy-title strong {
  color: var(--desk-text);
}

.strategy-title span {
  color: var(--desk-muted);
}

.focus-card {
  padding: 12px;
}

.focus-card h3 {
  color: var(--desk-text);
  font-size: 16px;
}

.focus-card p,
.focus-empty p {
  color: var(--desk-muted);
}

.focus-money strong {
  background: rgba(32, 210, 131, 0.13);
  color: var(--desk-green);
}

.focus-empty {
  border-color: rgba(255, 182, 77, 0.28);
  background: rgba(255, 182, 77, 0.07);
}

.focus-empty strong {
  color: var(--desk-amber);
}

.route-buy {
  background: rgba(74, 163, 255, 0.13);
  color: var(--desk-blue);
}

.route-sell {
  background: rgba(32, 210, 131, 0.14);
  color: var(--desk-green);
}

.route-arrow {
  color: var(--desk-dim);
}

.route-button:hover {
  background: rgba(32, 210, 131, 0.08);
}

.table-wrap {
  scrollbar-color: rgba(32, 210, 131, 0.44) #071116;
}

table {
  background: #071116;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(151, 190, 173, 0.09);
  font-size: 13px;
}

th {
  top: 0;
  background: #0d1b21;
  color: #9eb3aa;
}

td {
  color: #dcebe5;
}

tr:hover td {
  background: rgba(32, 210, 131, 0.055);
}

.opportunity-row,
.opportunity-row:nth-child(odd) {
  background: transparent;
}

.opportunity-row.risk-低 {
  box-shadow: inset 4px 0 0 var(--desk-green);
}

.opportunity-row.risk-中 {
  box-shadow: inset 4px 0 0 var(--desk-amber);
}

.opportunity-row.risk-高 {
  box-shadow: inset 4px 0 0 var(--desk-red);
}

.buy-price {
  color: var(--desk-blue);
}

.sell-price,
.profit-cell {
  color: var(--desk-green);
}

.roi-pill {
  background: rgba(32, 210, 131, 0.13);
  color: var(--desk-green);
}

.stale-row {
  opacity: 0.5;
}

.empty {
  color: var(--desk-muted);
}

.comparison-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.comparison-sheet {
  color: var(--desk-text);
}

.comparison-hero {
  background: linear-gradient(135deg, #101d23, #071116);
}

.comparison-brand p,
.comparison-brand span,
.comparison-product h3,
.comparison-platform-copy strong,
.comparison-price strong {
  color: var(--desk-text);
}

.comparison-product p,
.comparison-platform-copy span {
  color: var(--desk-muted);
}

.comparison-product strong,
.comparison-proof span {
  color: var(--desk-green);
}

.comparison-proof,
.comparison-row {
  border-color: var(--desk-line);
  background: rgba(13, 27, 33, 0.64);
}

.comparison-row.is-best {
  border-color: var(--desk-line-strong);
  background: rgba(32, 210, 131, 0.09);
}

.shoe-thumb {
  background: #101d23;
  color: var(--desk-muted);
}

@media (max-width: 1180px) {
  .manual-form,
  .product-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .source-platforms,
  .data-sources {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding-top: 10px;
  }

  .topbar,
  .panel-head,
  .alert-card {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
  }

  .brand-lockup {
    min-width: 0;
  }

  .search,
  .grid,
  .metrics,
  .freshness-bar,
  .source-platforms,
  .data-sources,
  .opportunity-buckets,
  .focus-strategy,
  .manual-form,
  .product-form {
    grid-template-columns: 1fr;
  }

  .search {
    min-width: 0;
  }

  .alert-card {
    padding: 58px 16px 16px;
  }

  .alert-card::before {
    top: 14px;
    left: 16px;
  }
}

/* Target dashboard match: terminal trading workspace */
body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 24% -18%, rgba(32, 210, 131, 0.12), transparent 28%),
    radial-gradient(circle at 75% 0, rgba(40, 137, 255, 0.08), transparent 24%),
    #04090d;
}

.terminal-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  width: min(1520px, calc(100% - 28px));
  min-height: calc(100vh - 20px);
  margin: 10px auto;
  padding: 0;
}

.sidebar {
  position: sticky;
  top: 10px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 20px);
  border: 1px solid rgba(113, 149, 136, 0.16);
  border-radius: 8px;
  padding: 14px 12px;
  background: linear-gradient(180deg, rgba(9, 18, 24, 0.98), rgba(3, 8, 12, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.sidebar .brand-lockup {
  min-width: 0;
  gap: 10px;
  padding: 0 2px 16px;
  border-bottom: 1px solid rgba(151, 190, 173, 0.11);
}

.sidebar .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  color: #d8e8e1;
  background: #0b1218;
}

.sidebar h1 {
  font-size: 18px;
  line-height: 1.2;
  color: #f3fff9;
}

.sidebar .eyebrow {
  margin: 5px 0 0;
  color: #94a9a0;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  color: #9eb1a9;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.side-nav a:hover,
.side-nav a.is-active {
  color: #e9fff4;
  background: linear-gradient(90deg, rgba(32, 210, 131, 0.32), rgba(32, 210, 131, 0.08));
}

.sidebar-status {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.sidebar-status article {
  border: 1px solid rgba(151, 190, 173, 0.14);
  border-radius: 7px;
  padding: 12px;
  background: rgba(8, 16, 21, 0.9);
}

.sidebar-status span {
  display: block;
  color: #8da29a;
  font-size: 12px;
}

.sidebar-status strong {
  display: block;
  margin-top: 6px;
  color: #f0fbf6;
  font-size: 15px;
}

.workspace {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.workspace > .topbar {
  position: static;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  gap: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.search {
  display: grid;
  grid-template-columns: 1fr 110px;
  max-width: none;
  min-width: 0;
  gap: 8px;
}

.search input {
  height: 50px;
  border-color: rgba(128, 158, 148, 0.22);
  border-radius: 7px;
  padding-left: 20px;
  background: linear-gradient(180deg, rgba(13, 25, 32, 0.98), rgba(7, 14, 19, 0.98));
  font-size: 14px;
}

.search button {
  height: 50px;
  color: #eafff4;
}

.freshness-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.freshness-bar > div,
.freshness-bar .size-filter,
.auto-refresh,
.secondary-button {
  min-height: 50px;
  border-radius: 7px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(13, 25, 32, 0.98), rgba(7, 14, 19, 0.98));
}

.freshness-bar .size-filter {
  display: grid;
  grid-template-columns: auto 86px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--desk-line);
}

.freshness-bar .size-filter select {
  height: 32px;
  padding: 0 8px;
}

.freshness-bar span {
  font-size: 12px;
}

.freshness-bar strong {
  font-size: 13px;
}

.secondary-button {
  min-width: 142px;
  color: #eafff4;
  background: linear-gradient(180deg, rgba(12, 148, 91, 0.92), rgba(6, 103, 63, 0.92));
}

.deal-card.alert-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 250px repeat(4, minmax(86px, 1fr)) 92px;
  align-items: center;
  gap: 16px;
  min-height: 116px;
  border: 1px solid rgba(32, 210, 131, 0.52);
  border-radius: 8px;
  padding: 16px 18px;
  background:
    radial-gradient(circle at 17% 50%, rgba(32, 210, 131, 0.24), transparent 32%),
    linear-gradient(180deg, rgba(5, 48, 25, 0.82), rgba(5, 21, 16, 0.98));
  box-shadow: inset 0 0 0 1px rgba(32, 210, 131, 0.12), 0 0 30px rgba(17, 185, 104, 0.12);
}

.deal-card.alert-card::before {
  content: none;
}

.deal-thumb {
  display: grid;
  place-items: center;
  width: 88px;
  height: 66px;
  border: 1px solid rgba(232, 243, 238, 0.11);
  border-radius: 7px;
  background:
    radial-gradient(circle at 42% 44%, rgba(255, 255, 255, 0.16), transparent 38%),
    linear-gradient(145deg, #202a2e, #0b1217);
  color: #d8e7e0;
  font-weight: 900;
}

.deal-title span {
  display: block;
  margin-bottom: 7px;
  color: var(--desk-green);
  font-size: 13px;
  font-weight: 900;
}

.deal-title strong {
  display: block;
  color: #f5fff9;
  font-size: 18px;
  line-height: 1.25;
}

.deal-title p {
  margin-top: 7px;
  color: #9eb1a9;
  font-size: 13px;
}

.deal-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-left: 1px solid rgba(151, 190, 173, 0.13);
  border-right: 1px solid rgba(151, 190, 173, 0.13);
  min-height: 68px;
}

.deal-route span {
  border: 1px solid rgba(151, 190, 173, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  color: #e9fff4;
  background: rgba(232, 243, 238, 0.055);
  font-weight: 800;
}

.deal-route b {
  color: #e4eee9;
}

.deal-stat {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
}

.deal-stat span {
  color: #9eb1a9;
  font-size: 12px;
}

.deal-stat strong {
  color: var(--desk-green);
  font-size: 24px;
}

.deal-stat:nth-last-child(2) strong {
  color: var(--desk-blue);
}

.deal-action {
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(232, 243, 238, 0.1);
  color: #eefbf6;
  background: linear-gradient(180deg, rgba(31, 45, 50, 0.96), rgba(15, 24, 29, 0.96));
}

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

.metrics article {
  min-height: 104px;
  border-radius: 7px;
  padding: 18px 16px;
}

.metrics small {
  display: block;
  margin-top: 5px;
  color: #8da29a;
  font-size: 12px;
}

.metrics strong {
  font-size: 26px;
}

.work-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.55fr 1.35fr;
  gap: 10px;
  align-items: start;
}

.work-grid .panel {
  height: 334px;
  min-height: 0;
}

.panel {
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(14, 27, 34, 0.98), rgba(7, 15, 20, 0.98));
}

.panel-head {
  min-height: 52px;
  padding: 13px 14px;
}

.panel-head h2 {
  font-size: 15px;
}

.panel-head p {
  font-size: 12px;
}

.manual-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 12px;
  max-height: none;
  overflow: visible;
}

.manual-form input,
.manual-form select,
.product-form input,
.product-form select {
  height: 32px;
  font-size: 12px;
}

.manual-form input:nth-of-type(1),
.manual-form input:nth-of-type(5),
.manual-form button {
  grid-column: 1 / -1;
}

.manual-form button,
.product-form button {
  height: 34px;
}

.product-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 12px 0;
}

.product-form input:first-child,
.product-form input:nth-last-of-type(1),
.product-form button {
  grid-column: 1 / -1;
}

.products {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 132px;
  overflow: auto;
}

.product-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  border-radius: 7px;
  padding: 9px 10px;
}

.data-sources,
.platforms {
  grid-template-columns: 1fr;
  padding: 12px;
}

.data-sources {
  max-height: 166px;
  overflow: auto;
}

.data-source-card,
.platform-card {
  min-height: 56px;
  grid-template-columns: 0.9fr auto;
  align-items: center;
  gap: 6px 12px;
  padding: 10px;
}

.data-source-card p,
.platform-card p {
  grid-column: 1 / -1;
  margin-top: 0;
  font-size: 12px;
}

.compact-platforms {
  padding-top: 0;
  max-height: 84px;
  overflow: auto;
}

.compact-platforms .platform-card {
  min-height: auto;
  padding: 8px 10px;
}

.compact-platforms .platform-card p:last-child {
  display: none;
}

.opportunity-buckets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 12px 0;
}

.opportunity-buckets article {
  min-height: 84px;
  padding: 12px;
}

.focus-strategy {
  grid-template-columns: 1fr;
  padding: 10px 12px 12px;
  max-height: 186px;
  overflow: auto;
}

.focus-card,
.focus-empty {
  padding: 10px;
}

.focus-card h3 {
  font-size: 14px;
}

.source-platforms-panel {
  display: none;
}

.tables-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.18fr;
  gap: 10px;
}

.tables-grid .panel {
  min-height: 300px;
}

.table-wrap {
  max-height: 300px;
}

.quotes-table {
  min-width: 840px;
}

.opportunities-table {
  min-width: 1050px;
}

th,
td {
  padding: 9px 10px;
  font-size: 12px;
}

.quotes-table th:nth-child(2),
.quotes-table td:nth-child(2) {
  width: 190px;
}

.quotes-table td:nth-child(2),
.opportunities-table td:nth-child(3) {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  background: #101b21;
}

tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.018);
}

.platform-pill,
.route-buy,
.route-sell,
.roi-pill,
.risk-pill,
.freshness-pill,
.stock-pill {
  padding: 5px 8px;
  font-size: 12px;
}

.buy-price,
.sell-price,
.profit-cell,
.money-cell {
  font-weight: 800;
}

.comparison-sheet {
  border-radius: 8px;
}

@media (max-width: 1280px) {
  .terminal-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .workspace > .topbar,
  .work-grid,
  .tables-grid {
    grid-template-columns: 1fr;
  }

  .freshness-bar {
    flex-wrap: wrap;
  }

  .deal-card.alert-card {
    grid-template-columns: 80px 1fr repeat(2, minmax(86px, 1fr));
  }

  .deal-route,
  .deal-action {
    display: none;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .terminal-shell {
    grid-template-columns: 1fr;
    width: min(100% - 20px, 720px);
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .side-nav,
  .sidebar-status {
    display: none;
  }

  .search {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .deal-card.alert-card {
    grid-template-columns: 1fr;
  }

  .deal-thumb {
    width: 100%;
  }
}

/* Commercial product UI */
:root,
:root[data-theme="light"] {
  --app-bg: #edf2ef;
  --surface: #ffffff;
  --surface-2: #f5f8f6;
  --surface-3: #e8efeb;
  --text: #14231d;
  --muted: #607269;
  --dim: #82918a;
  --border: #d5dfda;
  --border-strong: #b7c7bf;
  --accent: #0d8a59;
  --accent-strong: #076c45;
  --accent-soft: #dff3e8;
  --blue: #1769aa;
  --blue-soft: #e2f0fb;
  --amber: #9a6500;
  --amber-soft: #fff1cd;
  --danger: #b43a36;
  --danger-soft: #fde8e6;
  --shadow: 0 10px 28px rgba(24, 47, 37, 0.08);
}

:root[data-theme="dark"] {
  --app-bg: #050b0f;
  --surface: #0a1419;
  --surface-2: #0f1c22;
  --surface-3: #14252b;
  --text: #edf7f2;
  --muted: #9aada4;
  --dim: #70857c;
  --border: #20333a;
  --border-strong: #315057;
  --accent: #21d486;
  --accent-strong: #10aa6a;
  --accent-soft: #0c3425;
  --blue: #58a9ff;
  --blue-soft: #102b42;
  --amber: #ffc15d;
  --amber-soft: #3b2c12;
  --danger: #ff746d;
  --danger-soft: #3d1d1d;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html {
  background: var(--app-bg);
  color: var(--text);
}

body,
.auth-page,
.admin-page {
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--text);
}

button,
input,
select {
  font-family: inherit;
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input::placeholder {
  color: var(--dim);
  opacity: 1;
}

.terminal-shell,
.commercial-shell {
  background: var(--app-bg);
  color: var(--text);
}

.terminal-shell .sidebar,
.admin-sidebar {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}

.brand-mark {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.brand-lockup h1,
.brand-lockup p,
.workspace,
.admin-workspace,
.panel-head h2,
.metrics strong,
td {
  color: var(--text);
}

.eyebrow,
.panel-head p,
.metrics span,
.metrics small,
.sidebar-status span,
.field > span,
.license-summary span,
.connection-summary > span,
.account-kicker,
th {
  color: var(--muted);
}

.side-nav a {
  color: var(--muted);
}

.side-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.side-nav a.is-active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-status article,
.account-toolbar,
.metrics article,
.panel,
.freshness-bar > div,
.freshness-bar label,
.auth-panel,
.auth-proof-grid article {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}

.sidebar-status strong {
  color: var(--text);
}

.metrics article,
.panel,
.deal-card.alert-card,
.sidebar-status article,
.data-source-card,
.platform-card,
.opportunity-buckets article,
.focus-card,
.focus-empty {
  background-image: none;
}

.metrics article::after,
.alert-card::before {
  display: none;
}

.metrics article {
  min-height: 94px;
}

.metrics strong {
  color: var(--accent);
}

.metrics article:nth-child(4) strong {
  color: var(--blue);
}

.metrics article:nth-child(6) strong {
  color: var(--amber);
}

.account-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(300px, 1.4fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 14px;
}

.account-identity,
.license-summary,
.connection-summary,
.account-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.workspace-switcher {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px 10px;
  min-width: 0;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.workspace-switcher > span,
.workspace-switcher > p {
  color: var(--muted);
  font-size: 12px;
}

.workspace-switcher > strong {
  color: var(--text);
  font-size: 13px;
}

.workspace-switcher-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 6px;
}

.workspace-switcher-actions button {
  min-height: 34px;
  height: auto;
  padding: 6px 10px;
  font-size: 12px;
}

.workspace-switcher-actions button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}

.workspace-switcher > p {
  grid-column: 1 / -1;
  min-height: 16px;
}

.internal-workspace-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 10px 14px;
  background: var(--accent-soft);
}

.internal-workspace-banner strong {
  color: var(--accent);
}

.internal-workspace-banner span {
  color: var(--muted);
  font-size: 13px;
}

.account-identity strong,
.license-summary strong {
  color: var(--text);
}

.connection-summary {
  overflow: hidden;
}

.connection-summary strong {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge,
.connection-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.active,
.connection-chip.connected {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.status-badge.suspended,
.connection-chip.error,
.connection-chip.expired,
.connection-chip.revocation_pending,
.connection-chip.reauthorization_required {
  background: var(--danger-soft);
  color: var(--danger);
}

.connection-chip.not_connected,
.connection-chip.pending,
.connection-chip.not_configured,
.connection-chip.authorization_pending,
.connection-chip.refresh_required,
.connection-chip.disconnected {
  background: var(--amber-soft);
  color: var(--amber);
}

.theme-toggle,
.quiet-button {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}

.theme-toggle:hover,
.quiet-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.workspace > .topbar {
  border-color: var(--border);
  background: var(--surface);
}

.workspace > .topbar .search input,
.workspace > .topbar .search button,
.field input,
.field select,
.freshness-bar select {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}

.workspace > .topbar .search button,
.primary-button,
.manual-form > button,
.product-form > button,
.admin-create-form > button {
  border: 1px solid var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
  box-shadow: none;
}

:root[data-theme="dark"] .workspace > .topbar .search button,
:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .manual-form > button,
:root[data-theme="dark"] .product-form > button,
:root[data-theme="dark"] .admin-create-form > button {
  color: #03110b;
  background: var(--accent);
}

.freshness-bar,
.workspace > .topbar {
  gap: 8px;
}

.freshness-bar > div,
.freshness-bar label {
  min-height: 40px;
  padding: 6px 10px;
}

.deal-card.alert-card {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
}

.deal-thumb {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.deal-title strong,
.deal-route span,
.deal-action {
  color: var(--text);
}

.deal-title p,
.deal-stat span {
  color: var(--muted);
}

.deal-route {
  border-color: var(--border);
}

.deal-route span,
.deal-action {
  border-color: var(--border);
  background: var(--surface-2);
}

.panel-head,
th,
td,
.strategy-title {
  border-color: var(--border);
}

table {
  background: var(--surface);
}

td {
  color: var(--text);
}

.table-wrap {
  scrollbar-color: var(--border-strong) var(--surface-2);
}

th {
  background: var(--surface-2);
}

tbody tr:nth-child(odd) td {
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
}

tbody tr:hover td {
  background: var(--accent-soft);
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field > span {
  font-size: 11px;
  font-weight: 700;
}

.manual-form,
.product-form {
  align-content: start;
}

.manual-form .field,
.product-form .field {
  grid-column: auto;
}

.manual-form .field-wide,
.product-form .field-wide {
  grid-column: 1 / -1;
}

.manual-form .field input,
.manual-form .field select,
.product-form .field input,
.product-form .field select {
  height: 30px;
}

.manual-form > button,
.product-form > button {
  grid-column: 1 / -1;
}

.data-source-card,
.platform-card,
.opportunity-buckets article,
.focus-card,
.focus-empty,
.product-chip {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.data-source-card p,
.platform-card p,
.focus-card p,
.focus-empty p,
.product-chip span {
  color: var(--muted);
}

.table-wrap {
  scrollbar-color: var(--border-strong) var(--surface-2);
}

.mobile-workspace-nav {
  display: none;
}

/* Login */
.auth-page {
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.72fr);
  width: min(1040px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  border-right: 1px solid var(--border);
  padding: 46px;
  background: var(--surface-2);
}

.auth-brand .brand-lockup {
  align-items: center;
}

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

.auth-brand .brand-lockup p {
  margin-top: 5px;
  color: var(--muted);
}

.auth-proof-grid {
  display: grid;
  gap: 10px;
}

.auth-proof-grid article {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 15px;
}

.auth-proof-grid article span {
  grid-row: 1 / span 2;
  color: var(--accent);
  font-weight: 800;
}

.auth-proof-grid article strong {
  color: var(--text);
}

.auth-proof-grid article p,
.auth-footnote,
.auth-help p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  padding: 42px;
}

.auth-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.auth-panel h2 {
  margin-top: 4px;
  color: var(--text);
  font-size: 24px;
}

.auth-form,
.admin-create-form {
  display: grid;
  gap: 14px;
}

.auth-form .field > span,
.admin-create-form .field > span {
  font-size: 13px;
}

.auth-form input,
.admin-create-form input,
.admin-create-form select {
  height: 44px;
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}

.auth-form button,
.admin-create-form button {
  height: 44px;
}

.form-status {
  min-height: 22px;
  color: var(--danger);
  font-size: 13px;
}

.auth-help {
  margin-top: 26px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.auth-registration {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.auth-registration-head strong {
  color: var(--text);
  font-size: 13px;
}

.auth-registration-head .form-status {
  margin-top: 5px;
}

.auth-help strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 13px;
}

/* Admin */
.commercial-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  width: min(1600px, calc(100% - 20px));
  min-height: calc(100vh - 20px);
  margin: 10px auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.admin-sidebar {
  min-height: calc(100vh - 22px);
  padding: 22px 14px;
}

.admin-workspace {
  min-width: 0;
  padding: 10px;
  background: var(--app-bg);
}

.admin-workspace > .account-toolbar {
  grid-template-columns: 1fr auto auto;
}

.admin-workspace .account-toolbar h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 20px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.admin-metrics article {
  min-height: 100px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 16px;
  background: var(--surface);
}

.admin-metrics span,
.admin-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-metrics strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--accent);
  font-size: 25px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(0, 1.18fr);
  gap: 10px;
  margin-bottom: 10px;
}

.admin-create-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
}

.admin-create-form > button,
.admin-create-form > .form-status {
  grid-column: 1 / -1;
}

.security-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.security-list article {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 13px;
  background: var(--surface-2);
}

.security-list strong,
.security-list span {
  display: block;
}

.security-list strong {
  color: var(--text);
  font-size: 13px;
}

.security-list span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.operations-panel {
  margin-bottom: 10px;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 16px;
}

.operations-grid article {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 13px;
  background: var(--surface-2);
}

.operations-grid span,
.operations-grid strong {
  display: block;
}

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

.operations-grid strong {
  overflow-wrap: anywhere;
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.operations-alert {
  margin: 0 16px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 12px 13px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.admin-table-panel,
.audit-panel {
  margin-bottom: 10px;
}

.invitation-one-time {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1.2fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0 16px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 14px;
  background: var(--accent-soft);
}

.invitation-one-time strong,
.invitation-one-time p {
  display: block;
}

.invitation-one-time p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.invitation-one-time code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.invitation-one-time .quiet-button {
  justify-self: end;
}

.invitation-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.invitation-table {
  min-width: 980px;
}

.customer-table {
  min-width: 1120px;
}

.customer-table td strong,
.customer-table td small {
  display: block;
}

.customer-table td small {
  margin-top: 4px;
  color: var(--dim);
}

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

.inline-actions select,
.inline-actions button {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
  font-size: 12px;
}

.audit-log {
  display: grid;
  max-height: 300px;
  overflow: auto;
}

.audit-log article {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 11px 14px;
}

.audit-log article:last-child {
  border-bottom: 0;
}

.audit-log p,
.audit-log time {
  color: var(--muted);
  font-size: 12px;
}

.audit-result {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.empty-state,
.table-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

td.table-empty,
tbody tr:nth-child(odd) td.table-empty,
tbody tr:hover td.table-empty {
  background: var(--surface-2);
  color: var(--muted);
}

@media (min-width: 1101px) {
  .work-grid {
    grid-template-columns: 1.25fr 1.3fr 1.55fr 1.35fr;
  }

  .manual-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .work-grid .panel {
    height: 374px;
  }

  #invitation-panel,
  .invitation-one-time,
  .invitation-table-wrap {
    min-width: 0;
  }
}

@media (min-width: 821px) and (max-width: 1100px) {
  #invitation-panel,
  .invitation-one-time,
  .invitation-table-wrap {
    min-width: 0;
  }

  .invitation-one-time code {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 1100px) {
  .account-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .admin-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body:not(.auth-page):not(.admin-page) {
    padding-bottom: 64px;
  }

  .terminal-shell,
  .commercial-shell {
    display: block;
    width: min(100% - 12px, 720px);
    margin: 6px auto;
    border-radius: 7px;
  }

  .terminal-shell .sidebar,
  .admin-sidebar {
    min-height: auto;
    padding: 14px;
  }

  .terminal-shell .side-nav,
  .terminal-shell .sidebar-status,
  .admin-sidebar .side-nav,
  .admin-sidebar .sidebar-status {
    display: none;
  }

  .workspace,
  .admin-workspace {
    padding: 8px;
  }

  .account-toolbar,
  .admin-workspace > .account-toolbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workspace-switcher {
    width: 100%;
    border-top: 1px solid var(--border);
    border-left: 0;
    padding-top: 10px;
    padding-left: 0;
  }

  .workspace-switcher-actions button {
    flex: 1;
  }

  .internal-workspace-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .connection-summary {
    flex-wrap: wrap;
  }

  .metrics,
  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics article,
  .admin-metrics article {
    min-height: 86px;
  }

  .manual-form,
  .product-form,
  .admin-create-form,
  .security-list {
    grid-template-columns: 1fr;
  }

  .manual-form .field,
  .product-form .field,
  .admin-create-form > * {
    grid-column: 1;
  }

  .work-grid .panel {
    height: auto;
    min-height: 280px;
  }

  .mobile-workspace-nav {
    position: fixed;
    z-index: 50;
    right: 8px;
    bottom: 8px;
    left: 8px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .mobile-workspace-nav a {
    min-width: 0;
    padding: 12px 4px;
    color: var(--muted);
    text-align: center;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-workspace-nav a:hover,
  .mobile-workspace-nav a:focus-visible {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .auth-page {
    padding: 10px;
  }

  .auth-shell {
    display: block;
    min-height: auto;
  }

  .auth-brand {
    gap: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 24px;
  }

  .auth-proof-grid,
  .auth-footnote {
    display: none;
  }

  .auth-panel {
    padding: 26px 22px;
  }

  #invitation-panel,
  .invitation-one-time,
  .invitation-table-wrap {
    min-width: 0;
  }

  .invitation-one-time {
    grid-template-columns: 1fr;
  }

  .invitation-one-time code {
    overflow-wrap: anywhere;
  }

  .invitation-one-time .quiet-button {
    justify-self: start;
  }

  .invitation-table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .metrics,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .account-toolbar-actions {
    width: 100%;
  }

  .account-toolbar-actions button {
    flex: 1;
  }

  .auth-panel-head {
    align-items: center;
  }
}

@media (max-width: 390px) {
  .auth-panel {
    min-width: 0;
    padding: 22px 16px;
  }

  .invitation-one-time,
  .invitation-table-wrap {
    min-width: 0;
  }

  .invitation-one-time code {
    overflow-wrap: anywhere;
  }

  .invitation-table-wrap {
    overflow-x: auto;
  }
}

/* Reference terminal pass: dense dark workspace with green opportunity signals. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --desk-bg: #02070b;
  --desk-panel: #091219;
  --desk-panel-2: #0d1820;
  --desk-border: #1b2c35;
  --desk-border-strong: #29414a;
  --desk-text: #e7f0ed;
  --desk-muted: #7d9392;
  --desk-green: #20d878;
  --desk-green-deep: #075c3b;
  --desk-blue: #4b9dff;
  --desk-amber: #f4bd42;
  --desk-red: #ff655d;
}

:root[data-theme="dark"] body {
  min-width: 320px;
  background: radial-gradient(circle at 60% -20%, rgba(20, 75, 59, .22), transparent 38%), var(--desk-bg);
  color: var(--desk-text);
}

:root[data-theme="dark"] .terminal-shell {
  width: min(1488px, calc(100% - 24px));
  min-height: calc(100vh - 24px);
  margin: 12px auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #17252d;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 18, 24, .98), rgba(2, 8, 12, .98));
  box-shadow: 0 0 0 1px rgba(0, 255, 154, .03), 0 26px 80px rgba(0,0,0,.42);
}

:root[data-theme="dark"] .terminal-shell .sidebar {
  width: 210px;
  padding: 18px 12px;
  border-right: 1px solid var(--desk-border);
  background: rgba(4, 12, 17, .74);
}

:root[data-theme="dark"] .brand-lockup {
  gap: 10px;
  padding: 0 4px 20px;
  border-bottom: 1px solid var(--desk-border);
}

:root[data-theme="dark"] .brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--desk-border-strong);
  border-radius: 7px;
  background: #0a151c;
  color: var(--desk-text);
  font-weight: 900;
}

:root[data-theme="dark"] .brand-lockup h1 { color: var(--desk-text); font-size: 19px; line-height: 1.15; }
:root[data-theme="dark"] .brand-lockup .eyebrow { margin-top: 5px; color: var(--desk-muted); font-size: 12px; }
:root[data-theme="dark"] .side-nav { gap: 5px; margin-top: 18px; }
:root[data-theme="dark"] .side-nav a {
  display: flex;
  min-height: 39px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #9aabaa;
  font-size: 13px;
}
:root[data-theme="dark"] .side-nav a::before { content: ""; width: 6px; height: 6px; margin-right: 10px; border: 1px solid currentColor; border-radius: 50%; }
:root[data-theme="dark"] .side-nav a.is-active { border-color: rgba(32,216,120,.22); background: linear-gradient(90deg, rgba(0, 112, 70, .7), rgba(0, 72, 50, .36)); color: #f0fff8; }
:root[data-theme="dark"] .side-nav a.is-active::before { border-color: var(--desk-green); background: var(--desk-green); box-shadow: 0 0 8px var(--desk-green); }

:root[data-theme="dark"] .workspace { padding: 16px 22px 18px; }
:root[data-theme="dark"] .topbar { align-items: center; gap: 14px; padding: 2px 0 16px; }
:root[data-theme="dark"] .search { min-width: 0; flex: 1; }
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] button {
  border: 1px solid var(--desk-border);
  border-radius: 6px;
  background: #0b161d;
  color: var(--desk-text);
}
:root[data-theme="dark"] input::placeholder { color: #607477; }
:root[data-theme="dark"] .search input { height: 48px; }
:root[data-theme="dark"] .search button,
:root[data-theme="dark"] .manual-form > button,
:root[data-theme="dark"] .product-form > button { border-color: #067945; background: #00683e; color: white; }
:root[data-theme="dark"] .search button:hover,
:root[data-theme="dark"] .manual-form > button:hover,
:root[data-theme="dark"] .product-form > button:hover { background: #078b50; }
:root[data-theme="dark"] .freshness-bar { gap: 12px; }
:root[data-theme="dark"] .freshness-bar > * { border: 1px solid var(--desk-border); border-radius: 6px; background: #0b161d; }
:root[data-theme="dark"] .freshness-bar label { padding: 5px 10px; }
:root[data-theme="dark"] .freshness-bar select { height: 30px; border: 0; background: transparent; }

:root[data-theme="dark"] .alerts { margin-bottom: 10px; }
:root[data-theme="dark"] .alert-card { border-color: #008b4e; border-radius: 7px; background: linear-gradient(100deg, rgba(0, 87, 50, .45), rgba(5, 24, 25, .75)); box-shadow: 0 0 20px rgba(0, 196, 108, .12); }
:root[data-theme="dark"] .metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
:root[data-theme="dark"] .metrics article { min-height: 90px; padding: 14px; border: 1px solid var(--desk-border); border-radius: 6px; background: linear-gradient(140deg, #0c171f, #081117); }
:root[data-theme="dark"] .metrics article::after { display: none; }
:root[data-theme="dark"] .metrics span { color: #9aabaa; font-size: 12px; }
:root[data-theme="dark"] .metrics strong { margin-top: 8px; color: var(--desk-text); font-size: 26px; }
:root[data-theme="dark"] .metrics small { color: var(--desk-muted); }
:root[data-theme="dark"] .metrics article:nth-child(4) strong,
:root[data-theme="dark"] .metrics article:nth-child(5) strong { color: var(--desk-green); }
:root[data-theme="dark"] .metrics article:nth-child(6) strong { color: var(--desk-red); }

:root[data-theme="dark"] .work-grid { grid-template-columns: 1.15fr 1.3fr 1.3fr 1.05fr; gap: 8px; }
:root[data-theme="dark"] .panel { border: 1px solid var(--desk-border); border-radius: 6px; background: linear-gradient(145deg, rgba(13, 24, 32, .98), rgba(7, 15, 20, .98)); box-shadow: none; }
:root[data-theme="dark"] .panel-head { min-height: 48px; padding: 12px 14px; border-bottom: 1px solid var(--desk-border); }
:root[data-theme="dark"] .panel-head h2 { color: var(--desk-text); font-size: 14px; }
:root[data-theme="dark"] .panel-head p { color: var(--desk-muted); font-size: 11px; }
:root[data-theme="dark"] .manual-panel,
:root[data-theme="dark"] .product-pool,
:root[data-theme="dark"] .data-sources-panel,
:root[data-theme="dark"] .focus-panel { min-height: 300px; }
:root[data-theme="dark"] .manual-form,
:root[data-theme="dark"] .product-form { gap: 8px; padding: 12px; }
:root[data-theme="dark"] .field span { color: #92a8a7; font-size: 11px; }
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select { height: 34px; padding: 0 9px; font-size: 12px; }
:root[data-theme="dark"] .manual-form > button,
:root[data-theme="dark"] .product-form > button { height: 34px; font-size: 12px; }
:root[data-theme="dark"] .products,
:root[data-theme="dark"] .data-sources,
:root[data-theme="dark"] .platforms,
:root[data-theme="dark"] .focus-strategy { padding: 10px 12px; }
:root[data-theme="dark"] .product-chip,
:root[data-theme="dark"] .data-source-card,
:root[data-theme="dark"] .platform-card,
:root[data-theme="dark"] .focus-card { border-color: var(--desk-border); border-radius: 5px; background: #0a151c; }
:root[data-theme="dark"] .strategy-block { border-color: var(--desk-border); background: #09141b; }
:root[data-theme="dark"] .strategy-title strong,
:root[data-theme="dark"] .focus-money strong { color: var(--desk-green); }

:root[data-theme="dark"] .source-platforms-panel,
:root[data-theme="dark"] .tables-grid { margin-top: 8px; }
:root[data-theme="dark"] .seller-export-panel { margin-top: 8px; }
:root[data-theme="dark"] .seller-export-form { display: grid; grid-template-columns: minmax(0, 1fr) 138px; gap: 10px; padding: 12px; }
:root[data-theme="dark"] .seller-export-form textarea { min-height: 106px; resize: vertical; border: 1px solid var(--desk-border); border-radius: 5px; background: #081319; color: #d5e7e1; font: 12px/1.55 Consolas, "Microsoft YaHei", monospace; padding: 10px; }
:root[data-theme="dark"] .seller-export-actions { display: grid; align-content: end; gap: 8px; }
:root[data-theme="dark"] .seller-export-actions button { height: 34px; font-size: 12px; }
:root[data-theme="dark"] .seller-export-actions button[type="submit"] { border-color: #067945; background: #00683e; color: white; }
:root[data-theme="dark"] .tables-grid { gap: 8px; }
:root[data-theme="dark"] .table-wrap { max-height: 285px; overflow: auto; }
:root[data-theme="dark"] table { color: #cfe0dc; font-size: 11px; }
:root[data-theme="dark"] th { color: #849a99; background: #0b171e; }
:root[data-theme="dark"] td { border-color: #1a2a32; }
:root[data-theme="dark"] tbody tr:nth-child(odd) td { background: rgba(12, 26, 33, .52); }
:root[data-theme="dark"] tbody tr:hover td { background: rgba(0, 103, 66, .24); }
:root[data-theme="dark"] .money-cell,
:root[data-theme="dark"] .opportunities-table td:nth-child(9) { color: var(--desk-green); font-weight: 800; }
:root[data-theme="dark"] .platform-pill { border-color: transparent; background: rgba(28, 144, 93, .2); color: #8deabb; }
:root[data-theme="dark"] .style-code { border-color: #263b41; background: #101f25; color: #bdd1cc; }
:root[data-theme="dark"] .freshness-pill.fresh { color: var(--desk-green); background: rgba(18, 170, 91, .12); }
:root[data-theme="dark"] .freshness-pill.stale { color: var(--desk-red); background: rgba(255, 101, 93, .12); }
:root[data-theme="dark"] .quiet-button,
:root[data-theme="dark"] .theme-toggle { border-color: var(--desk-border-strong); background: #0b161d; color: #b9cbc7; }

@media (max-width: 1100px) {
  :root[data-theme="dark"] .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :root[data-theme="dark"] .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  :root[data-theme="dark"] .terminal-shell { width: calc(100% - 12px); margin: 6px auto; }
  :root[data-theme="dark"] .terminal-shell .sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--desk-border); }
  :root[data-theme="dark"] .workspace { padding: 10px; }
  :root[data-theme="dark"] .topbar { display: block; }
  :root[data-theme="dark"] .search { margin-bottom: 8px; }
  :root[data-theme="dark"] .freshness-bar { overflow: auto; }
  :root[data-theme="dark"] .metrics,
  :root[data-theme="dark"] .work-grid { grid-template-columns: 1fr; }
  :root[data-theme="dark"] .tables-grid { grid-template-columns: 1fr; }
  :root[data-theme="dark"] .seller-export-form { grid-template-columns: 1fr; }
}

/* Wave 6 customer data center. */
.import-data-center {
  margin-top: 12px;
}

.import-data-center-head,
.import-subhead,
.import-trust-row,
.import-actions,
.import-template-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-trust-row {
  padding: 12px 14px;
  border-bottom: 1px solid #d4dfd8;
  color: #5f746b;
  font-size: 13px;
}

.status-warning {
  border-color: #d89a28;
  background: #fff4d6;
  color: #7c5200;
}

.status-success {
  border-color: #159058;
  background: #e4f7ed;
  color: #075f38;
}

.import-upload-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(140px, .7fr) minmax(190px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
}

.import-upload-form input[type="file"] {
  padding: 8px;
}

.import-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  border-top: 1px solid #d4dfd8;
}

.import-preview-section,
.import-mapping-section,
.import-history-section {
  min-width: 0;
  padding: 14px;
}

.import-preview-section {
  border-right: 1px solid #d4dfd8;
}

.import-history-section {
  border-top: 1px solid #d4dfd8;
}

.import-subhead {
  align-items: baseline;
  margin-bottom: 10px;
}

.import-subhead h3 {
  margin: 0;
  font-size: 14px;
}

.import-subhead span {
  color: #71847c;
  font-size: 12px;
}

.import-preview {
  min-height: 156px;
  max-height: 330px;
  overflow: auto;
  border: 1px solid #d4dfd8;
  border-radius: 6px;
}

.import-preview-table {
  min-width: 680px;
}

.import-preview .empty {
  padding: 24px;
}

.import-mapping {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.import-mapping-field {
  display: grid;
  gap: 5px;
}

.import-mapping-field span {
  color: #5f746b;
  font-size: 11px;
  font-weight: 700;
}

.import-mapping-field select {
  height: 36px;
  padding: 0 9px;
  font-size: 12px;
}

.import-template-controls {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 12px;
}

.import-template-controls .field {
  min-width: 180px;
  flex: 1;
}

.import-template-controls .auto-refresh {
  min-height: 44px;
}

.import-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.import-job-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.import-job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  padding: 12px;
  border: 1px solid #d4dfd8;
  border-radius: 6px;
  background: #f8fbf9;
}

.import-job-card strong,
.import-job-card p,
.import-job-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-job-card p,
.import-job-card small {
  grid-column: 1 / -1;
}

.import-job-card small {
  color: #667b72;
}

.import-job-card button {
  grid-column: 1 / -1;
  justify-self: start;
  height: 34px;
}

:root[data-theme="dark"] .import-data-center,
:root[data-theme="dark"] .import-preview,
:root[data-theme="dark"] .import-job-card {
  border-color: var(--desk-border);
}

:root[data-theme="dark"] .import-trust-row,
:root[data-theme="dark"] .import-workspace-grid,
:root[data-theme="dark"] .import-preview-section,
:root[data-theme="dark"] .import-history-section {
  border-color: var(--desk-border);
}

:root[data-theme="dark"] .import-trust-row,
:root[data-theme="dark"] .import-subhead span,
:root[data-theme="dark"] .import-mapping-field span,
:root[data-theme="dark"] .import-job-card small {
  color: var(--desk-muted);
}

:root[data-theme="dark"] .status-warning {
  border-color: rgba(244, 189, 66, .45);
  background: rgba(244, 189, 66, .12);
  color: var(--desk-amber);
}

:root[data-theme="dark"] .status-success {
  border-color: rgba(32, 216, 120, .4);
  background: rgba(32, 216, 120, .1);
  color: var(--desk-green);
}

:root[data-theme="dark"] .import-preview,
:root[data-theme="dark"] .import-job-card {
  background: #081319;
}

@media (max-width: 1100px) {
  .import-upload-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-workspace-grid {
    grid-template-columns: 1fr;
  }

  .import-preview-section {
    border-right: 0;
    border-bottom: 1px solid #d4dfd8;
  }

  .import-job-history {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .import-data-center-head,
  .import-trust-row,
  .import-subhead {
    align-items: flex-start;
    flex-direction: column;
  }

  .import-upload-form,
  .import-mapping,
  .import-job-history {
    grid-template-columns: 1fr;
  }

  .import-template-controls,
  .import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .import-template-controls > *,
  .import-actions button {
    width: 100%;
  }
}

/* Wave 6 ranked opportunity workbench. */
.opportunity-workbench {
  position: relative;
  margin-top: 12px;
  overflow: clip;
}

.opportunity-workbench-head,
.opportunity-head-actions,
.opportunity-filter-actions,
.opportunity-detail-head,
.opportunity-mobile-actions,
.opportunity-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.opportunity-filter-drawer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .28fr);
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #d4dfd8;
  background: #f8fbf9;
}

.opportunity-filter-drawer-head { display: none; }

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

.opportunity-filter-form .auto-refresh {
  align-self: end;
  min-height: 42px;
}

.opportunity-filter-actions {
  align-self: end;
  justify-content: flex-start;
}

.opportunity-saved-filters {
  display: grid;
  align-content: start;
  gap: 10px;
}

.opportunity-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: #d4dfd8;
}

.opportunity-tabs button {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: #f4f8f5;
  color: #496258;
}

.opportunity-tabs button[aria-selected="true"] {
  background: #0a7a49;
  color: #fff;
}

.opportunity-feed-area {
  min-width: 0;
  padding: 14px;
}

.opportunity-feed-area > .status-badge {
  display: inline-flex;
  margin-bottom: 10px;
}

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

.opportunity-card,
.opportunity-history-card,
.opportunity-metric,
.opportunity-detail-sheet {
  min-width: 0;
  border: 1px solid #d4dfd8;
  border-radius: 7px;
  background: #fff;
}

.opportunity-card {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.opportunity-card h3,
.opportunity-card p,
.opportunity-card strong,
.opportunity-history-card > *,
.opportunity-detail-sheet p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.opportunity-profit {
  color: #087344;
  font-size: 20px;
}

.opportunity-score {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.opportunity-score > p {
  grid-column: 1 / -1;
  font-size: 12px;
}

.opportunity-score-part {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 5px;
  background: #eef5f0;
}

.opportunity-score-part small {
  color: #687d73;
  font-size: 10px;
}

.opportunity-missing { color: #986200; }
.opportunity-complete { color: #087344; }

.opportunity-metrics-list {
  display: grid;
  gap: 6px;
}

.opportunity-metric {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: #f8fbf9;
  font-size: 11px;
}

.opportunity-detail-sheet {
  position: sticky;
  bottom: 8px;
  z-index: 12;
  display: grid;
  gap: 12px;
  margin: 14px;
  padding: 14px;
  box-shadow: 0 18px 50px rgba(16, 46, 34, .2);
}

.opportunity-detail-sheet[hidden] { display: none; }

#opportunity-detail-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: min(62vh, 620px);
  overflow: auto;
}

#opportunity-detail-content > section,
.opportunity-detail-summary {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #d4dfd8;
  border-radius: 6px;
}

.opportunity-detail-links,
.opportunity-detail-sources,
.opportunity-warnings {
  grid-column: 1 / -1;
}

.opportunity-safe-link { color: #087344; font-weight: 800; }
.opportunity-link-disabled { color: #819087; cursor: not-allowed; }

.status-muted {
  border-color: #aebbb5;
  background: #edf1ef;
  color: #607067;
}

.opportunity-history-panel {
  padding: 14px;
  border-top: 1px solid #d4dfd8;
}

.opportunity-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.opportunity-history-card {
  display: grid;
  gap: 6px;
  padding: 11px;
  background: #f8fbf9;
}

.opportunity-history-card button { justify-self: start; }

:root[data-theme="dark"] .opportunity-filter-drawer,
:root[data-theme="dark"] .opportunity-tabs,
:root[data-theme="dark"] .opportunity-history-panel,
:root[data-theme="dark"] .opportunity-card,
:root[data-theme="dark"] .opportunity-history-card,
:root[data-theme="dark"] .opportunity-metric,
:root[data-theme="dark"] .opportunity-detail-sheet,
:root[data-theme="dark"] #opportunity-detail-content > section,
:root[data-theme="dark"] .opportunity-detail-summary {
  border-color: var(--desk-border);
}

:root[data-theme="dark"] .opportunity-filter-drawer,
:root[data-theme="dark"] .opportunity-card,
:root[data-theme="dark"] .opportunity-history-card,
:root[data-theme="dark"] .opportunity-metric,
:root[data-theme="dark"] .opportunity-detail-sheet {
  background: #081319;
  color: var(--desk-text);
}

:root[data-theme="dark"] .opportunity-tabs { background: var(--desk-border); }
:root[data-theme="dark"] .opportunity-tabs button { background: #0a151c; color: #aebfbb; }
:root[data-theme="dark"] .opportunity-tabs button[aria-selected="true"] { background: #00683e; color: #fff; }
:root[data-theme="dark"] .opportunity-score-part { background: #0d2022; }
:root[data-theme="dark"] .opportunity-score-part small { color: var(--desk-muted); }
:root[data-theme="dark"] .opportunity-profit,
:root[data-theme="dark"] .opportunity-complete,
:root[data-theme="dark"] .opportunity-safe-link { color: var(--desk-green); }
:root[data-theme="dark"] .opportunity-missing { color: var(--desk-amber); }
:root[data-theme="dark"] .status-muted { border-color: var(--desk-border-strong); background: #101e24; color: var(--desk-muted); }

@media (max-width: 1100px) {
  .opportunity-filter-drawer { grid-template-columns: 1fr; }
  .opportunity-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opportunity-saved-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opportunity-card-grid { grid-template-columns: 1fr; }
  .opportunity-history { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .opportunity-workbench { overflow: visible; }
  .opportunity-workbench-head { align-items: flex-start; flex-direction: column; }
  .opportunity-head-actions { width: 100%; }
  .opportunity-head-actions button { flex: 1; }
  .opportunity-filter-drawer {
    position: fixed;
    inset: 0 0 66px auto;
    z-index: 40;
    width: min(92vw, 380px);
    overflow: auto;
    transform: translateX(105%);
    transition: transform .18s ease;
    box-shadow: -18px 0 45px rgba(0, 0, 0, .24);
  }
  .opportunity-filter-drawer-head {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .opportunity-filter-drawer[data-open="true"] { transform: translateX(0); }
  .opportunity-filter-form,
  .opportunity-saved-filters,
  .opportunity-card-grid,
  .opportunity-history,
  #opportunity-detail-content { grid-template-columns: 1fr; }
  .opportunity-tabs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .opportunity-tabs button {
    flex: 0 0 auto;
    min-width: 142px;
    scroll-snap-align: start;
  }
  .opportunity-score { grid-template-columns: 1fr; }
  .opportunity-score > p { grid-column: 1; }
  .opportunity-detail-sheet {
    position: fixed;
    inset: 46px 8px 62px;
    z-index: 35;
    margin: 0;
    overflow: auto;
  }
  .opportunity-detail-links,
  .opportunity-detail-sources,
  .opportunity-warnings { grid-column: 1; }
  .opportunity-mobile-actions {
    position: sticky;
    bottom: 0;
    padding: 9px 0 0;
    background: inherit;
  }
  .opportunity-mobile-actions button { flex: 1; }
}

/* Wave 8.3: restrained market ambience, aligned work panels, and brand polish. */
.market-particles {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.62;
}

body > main {
  position: relative;
  z-index: 1;
}

body > .mobile-workspace-nav,
body > .comparison-modal {
  z-index: 1;
}

.brand-mark {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  padding: 5px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.commercial-account-grid > section:last-child {
  border-right: 0;
}

.account-membership {
  grid-column: span 2;
}

.account-payment,
.account-orders {
  grid-column: span 2;
}

#billing-plans {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#payment-providers {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.commercial-account-grid .security-list article {
  min-width: 0;
  border: 0;
  border-left: 2px solid var(--border-strong);
  border-radius: 0;
  padding: 9px 10px;
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.commercial-account-grid .security-list button {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 34px;
  white-space: normal;
}

.billing-plan-summary {
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.billing-plan-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.commercial-account-grid .billing-plan-actions button {
  padding-right: 8px;
  padding-left: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.work-grid {
  align-items: stretch;
}

.work-grid .scroll-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.work-grid .panel-head {
  align-items: flex-start;
  gap: 8px;
}

.work-grid .panel-head h2 {
  flex: 0 0 auto;
  white-space: nowrap;
}

.work-grid .panel-head p {
  min-width: 0;
  line-height: 1.4;
}

.panel-scroll-body {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: var(--border-strong) var(--surface-2);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.panel-scroll-body .products {
  max-height: none;
  overflow: visible;
}

.data-source-scroll .data-sources {
  max-height: none;
  overflow: visible;
}

.focus-panel-scroll .focus-strategy {
  max-height: none;
  overflow: visible;
}

.platform-guide {
  margin-bottom: 10px;
  overflow: hidden;
}

.platform-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  padding: 14px;
}

.platform-guide details {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.platform-guide details[open] {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.platform-guide summary {
  padding: 14px;
  color: var(--text);
  cursor: pointer;
}

.platform-guide summary span {
  margin-right: 8px;
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.platform-guide details > div {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.platform-guide details p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.auth-brand {
  position: relative;
  overflow: hidden;
}

.auth-shoe-visual {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  min-height: 176px;
  margin: -6px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    radial-gradient(circle at 34% 42%, var(--accent-soft), transparent 48%),
    var(--surface);
}

.auth-shoe-visual img {
  align-self: center;
  width: min(100%, 390px);
  height: 170px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.22));
}

.auth-shoe-visual figcaption {
  display: grid;
  gap: 4px;
  padding: 18px;
  text-align: right;
}

.auth-shoe-visual figcaption span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.auth-shoe-visual figcaption strong {
  max-width: 120px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

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

@media (max-width: 820px) {
  .work-grid .scroll-panel {
    display: block;
  }

  .panel-scroll-body {
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .focus-strategy {
    max-height: none;
    overflow: visible;
  }

  .opportunity-buckets article:last-child {
    grid-column: 1 / -1;
  }

  .platform-guide-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .mobile-workspace-nav {
    grid-template-columns: repeat(8, minmax(64px, 1fr));
    overflow-x: auto;
  }

  .auth-shoe-visual {
    grid-template-columns: 1fr;
  }

  .auth-shoe-visual figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
  }
}

@media (max-width: 620px) {
  .account-membership,
  .account-payment,
  .account-orders {
    grid-column: span 1;
  }

  #billing-plans,
  #payment-providers {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .market-particles {
    opacity: 0.32;
  }
}
