:root {
  --shell-ink: #18221f;
  --shell-muted: #66716d;
  --shell-bg: #f3f5f4;
  --shell-card: #ffffff;
  --shell-line: #dfe5e2;
  --shell-sidebar: #14201d;
  --shell-sidebar-muted: #91a09a;
  --shell-primary: #176b55;
  --shell-primary-soft: #e8f2ef;
  --shell-amber: #b7791f;
  --shell-amber-soft: #fff7e8;
  --shell-red: #b8423b;
  --shell-red-soft: #fff0ef;
  --shell-blue: #2f6f9f;
  --shell-blue-soft: #edf5fa;
}

/* Unified workspace search */
.unified-search-page {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.unified-search-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 0 20px;
  border-bottom: 1px solid #dfe5e2;
}

.unified-search-head h2 {
  margin: 4px 0 7px;
  font-size: 24px;
  letter-spacing: 0;
}

.unified-search-head p:last-child {
  margin: 0;
  color: #66736e;
  font-size: 13px;
}

.unified-search-scope {
  flex: none;
  padding: 6px 9px;
  border: 1px solid #cdd8d4;
  border-radius: 4px;
  background: #f6f8f7;
  color: #344d45;
  font-size: 12px;
}

.unified-search-query {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  margin: 20px 0 14px;
  padding: 5px 6px 5px 14px;
  border: 1px solid #aebcb7;
  border-radius: 6px;
  background: #fff;
}

.unified-search-query:focus-within {
  border-color: #4f7f70;
  box-shadow: 0 0 0 3px rgba(79, 127, 112, .11);
}

.unified-search-query svg {
  width: 18px;
  height: 18px;
  color: #68756f;
}

.unified-search-query input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
}

.unified-search-query button,
.unified-search-open,
.unified-search-reset,
.unified-search-pagination button {
  border: 1px solid #355f52;
  border-radius: 5px;
  background: #355f52;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.unified-search-query button {
  min-width: 76px;
  min-height: 38px;
  padding: 0 16px;
}

.unified-search-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  align-items: end;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid #edf0ee;
  border-bottom: 1px solid #dfe5e2;
}

.unified-search-filters label,
.unified-search-custom-time label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #6f7a76;
  font-size: 11px;
}

.unified-search-filters select,
.unified-search-custom-time input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid #d4dcda;
  border-radius: 4px;
  background: #fff;
  color: #27332f;
  font: inherit;
  font-size: 12px;
}

.unified-search-reset {
  min-height: 36px;
  padding: 0 13px;
  border-color: #c9d1ce;
  background: #fff;
  color: #53615c;
}

.unified-search-custom-time {
  display: flex;
  gap: 10px;
  padding: 12px 0 0;
}

.unified-search-custom-time[hidden] {
  display: none;
}

.unified-search-custom-time label {
  width: min(220px, 50%);
}

.unified-search-types {
  display: flex;
  gap: 5px;
  margin-top: 18px;
  padding-bottom: 2px;
  overflow-x: auto;
}

.unified-search-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #5e6965;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.unified-search-type b {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 10px;
  background: #edf1ef;
  color: #53605b;
  font: 10px 'DM Mono', monospace;
  text-align: center;
}

.unified-search-type.active {
  border-color: #9fb8af;
  background: #edf4f1;
  color: #244c40;
  font-weight: 600;
}

.unified-search-type.active b {
  background: #355f52;
  color: #fff;
}

.unified-search-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 9px;
  color: #78827e;
  font-size: 12px;
}

.unified-search-summary strong {
  color: #27332f;
  font-size: 14px;
}

.unified-search-results {
  border-top: 1px solid #d9e0dd;
}

.unified-search-result {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 17px 4px;
  border-bottom: 1px solid #e3e8e6;
}

.unified-search-result:hover {
  background: #fafcfb;
}

.unified-search-result-type {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 3px;
  background: #e9f1ee;
  color: #315d50;
  font-size: 11px;
  text-align: center;
}

.unified-search-result-type.type-policy,
.unified-search-result-type.type-rule {
  background: #edf1f7;
  color: #3d5575;
}

.unified-search-result-type.type-product,
.unified-search-result-type.type-shop {
  background: #fff3e5;
  color: #8b5a20;
}

.unified-search-result-type.type-content {
  background: #f5edf5;
  color: #6e4b70;
}

.unified-search-result-body {
  min-width: 0;
}

.unified-search-result-body h3 {
  margin: 0 0 4px;
  color: #22302b;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

.unified-search-result-body p {
  margin: 0;
  overflow-wrap: anywhere;
}

.unified-search-result-subtitle {
  color: #596762;
  font-size: 12px;
}

.unified-search-result-description {
  display: -webkit-box;
  margin-top: 7px !important;
  overflow: hidden;
  color: #78827e;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.unified-search-result-body small {
  display: block;
  margin-top: 8px;
  color: #8a9490;
  font-size: 10px;
}

.unified-search-open {
  min-width: 54px;
  min-height: 32px;
  padding: 0 10px;
  border-color: #bdc9c5;
  background: #fff;
  color: #355f52;
}

.unified-search-result-actions {
  display: grid;
  gap: 7px;
  justify-items: stretch;
  min-width: 78px;
}

.unified-search-source-link {
  color: #2f6f5e;
  font-size: 11px;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.unified-search-page-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 8px;
  color: #65716c;
  font-size: 11px;
}

.unified-search-error .unified-search-open {
  margin-top: 14px;
}

.ovr-history-citation {
  color: #176b55;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ovr-history-sources {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dfe5e2;
}

.ovr-history-sources a {
  color: #315d50;
  font-size: 12px;
  line-height: 1.45;
}

.unified-search-empty {
  padding: 64px 20px;
  border-bottom: 1px solid #e3e8e6;
  text-align: center;
}

.unified-search-empty h3 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: 0;
}

.unified-search-empty p {
  max-width: 560px;
  margin: 0 auto;
  color: #78827e;
  font-size: 12px;
  line-height: 1.6;
}

.unified-search-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 18px 0 6px;
}

.unified-search-pagination button {
  min-width: 34px;
  min-height: 32px;
  padding: 0 9px;
  border-color: #c9d2cf;
  background: #fff;
  color: #53615c;
}

.unified-search-pagination button.active {
  border-color: #355f52;
  background: #355f52;
  color: #fff;
}

.unified-search-pagination button:disabled {
  cursor: default;
  opacity: .45;
}

#search-results .result {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.search-results-empty {
  margin: 0;
  padding: 13px 10px;
  color: #7b8782;
  font-size: 11px;
  line-height: 1.5;
}

.search-results-all {
  width: 100%;
  min-height: 35px;
  margin-top: 4px;
  border: 0;
  border-top: 1px solid #e4e9e7;
  background: #fff;
  color: #315d50;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
}

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

  .unified-search-reset {
    width: fit-content;
  }
}

@media (max-width: 600px) {
  .unified-search-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .unified-search-head h2 {
    font-size: 20px;
  }

  .unified-search-query {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    padding-left: 10px;
  }

  .unified-search-query button {
    min-width: 58px;
    padding: 0 10px;
  }

  .unified-search-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .unified-search-custom-time {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unified-search-custom-time[hidden] {
    display: none;
  }

  .unified-search-custom-time label {
    width: auto;
  }

  .unified-search-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .unified-search-result {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 15px 0;
  }

  .unified-search-result-actions {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
  }

  .unified-search-open {
    grid-column: auto;
    width: fit-content;
  }
}

* {
  letter-spacing: 0 !important;
}

html {
  background: var(--shell-bg);
}

body {
  background: var(--shell-bg);
  color: var(--shell-ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(23, 107, 85, 0.22);
  outline-offset: 2px;
}

/* Auth */
.login-page {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  grid-template-columns: minmax(480px, 1.08fr) minmax(420px, 0.92fr);
  min-height: 100vh;
  background: #fff;
  overflow-y: auto;
}

.login-product {
  min-height: 100vh;
  padding: 42px clamp(42px, 6vw, 88px);
  display: flex;
  flex-direction: column;
  background: var(--shell-sidebar);
  color: #f6faf8;
}

.login-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  color: inherit;
  text-decoration: none;
}

.brand-glyph {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f0ed;
  color: #163b31;
  font-size: 21px;
  font-weight: 800;
}

.login-brand-lockup strong,
.login-brand-lockup small {
  display: block;
}

.login-brand-lockup strong {
  font-size: 18px;
}

.login-brand-lockup small {
  margin-top: 2px;
  color: #95a59f;
  font-size: 11px;
}

.login-product-copy {
  width: min(620px, 100%);
  margin: auto 0;
}

.login-kicker,
.workspace-kicker,
.section-label {
  margin: 0;
  color: #83b9aa;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-product-copy h1 {
  margin: 18px 0 20px;
  color: #fff;
  font-family: inherit;
  font-size: clamp(34px, 3.5vw, 54px);
  font-weight: 700;
  line-height: 1.28;
}

.login-product-copy > p:not(.login-kicker) {
  max-width: 570px;
  margin: 0;
  color: #b5c2bd;
  font-size: 15px;
  line-height: 1.9;
}

.login-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 46px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  overflow: hidden;
}

.login-proof-grid div {
  padding: 18px 20px;
  background: #192923;
}

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

.login-proof-grid strong {
  color: #fff;
  font-size: 24px;
}

.login-proof-grid span {
  margin-top: 4px;
  color: #91a09a;
  font-size: 11px;
}

.login-source-note {
  margin: 24px 0 0;
  color: #7f918a;
  font-size: 11px;
}

.login-auth {
  min-height: 100vh;
  padding: 56px clamp(32px, 6vw, 92px);
  display: grid;
  place-items: center;
  background: #fff;
}

.auth-card {
  width: min(420px, 100%);
}

.auth-card-head > p {
  margin: 0 0 10px;
  color: var(--shell-primary);
  font-size: 12px;
  font-weight: 700;
}

.auth-card-head h2 {
  margin: 0;
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 28px;
  line-height: 1.35;
}

.auth-card-head > span {
  display: block;
  margin-top: 10px;
  color: var(--shell-muted);
  font-size: 13px;
}

.auth-card .auth-tabs {
  margin: 34px 0 20px;
}

.auth-card .auth-tabs button.active {
  color: var(--shell-primary);
  border-bottom-color: var(--shell-primary);
}

.auth-card .auth-field label {
  margin: 13px 0 6px;
  color: var(--shell-ink);
  font-size: 12px;
  font-weight: 600;
}

.auth-card .auth-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--shell-ink);
  background: #fff;
}

.auth-form-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: #8a9490;
  font-size: 11px;
}

.auth-form-meta button,
.auth-demo-row button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--shell-primary);
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  border: 0;
  border-radius: 6px;
  background: var(--shell-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.auth-submit:hover {
  background: #125c49;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-error {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--shell-red-soft);
  text-align: left;
}

.auth-demo-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--shell-muted);
  font-size: 12px;
}

.auth-terms {
  margin: 28px 0 0;
  color: #9aa39f;
  text-align: center;
  font-size: 10px;
}

/* Application shell */
.main-app.active {
  display: block;
}

body aside.sidebar {
  width: 248px;
  padding: 0;
  background: var(--shell-sidebar);
  border: 0;
  color: #fff;
  box-shadow: none;
  overflow: hidden;
  z-index: 100;
}

aside.sidebar .sidebar-logo {
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 11px;
}

aside.sidebar .sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 8px;
  background: #e7f0ed;
  color: #163b31;
  font-size: 18px;
}

.logo-copy {
  min-width: 0;
}

aside.sidebar .logo-text,
.logo-copy small {
  display: block;
}

aside.sidebar .logo-text {
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
}

.logo-copy small {
  margin-top: 2px;
  color: var(--shell-sidebar-muted);
  font-size: 10px;
}

aside.sidebar .sidebar-nav {
  max-height: none;
  padding: 12px 10px 16px;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #3a4a45 transparent;
}

.nav-section {
  display: grid;
  gap: 2px;
}

.nav-section + .nav-section {
  margin-top: 8px;
}

.nav-section-label {
  margin: 0;
  padding: 7px 10px 5px;
  color: #70807a;
  font-size: 10px;
  font-weight: 700;
}

aside.sidebar .nav-item {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #aebbb6;
  font-size: 13px;
  text-align: left;
}

aside.sidebar .nav-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: #81908a;
  stroke-width: 1.8;
}

aside.sidebar .nav-item .nav-text {
  color: inherit;
  font-size: inherit;
}

aside.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

aside.sidebar .nav-item.active {
  background: #e7f0ed;
  color: #153c31;
  font-weight: 700;
}

aside.sidebar .nav-item.active svg {
  color: var(--shell-primary);
}

aside.sidebar .nav-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 10px;
  background: #a83d37;
  color: #fff;
  font-size: 10px;
}

aside.sidebar .sidebar-footer {
  min-height: 70px;
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

aside.sidebar .user-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 7px;
  background: #d5e5df;
  color: #164837;
}

aside.sidebar .user-name {
  color: #eef4f1;
  font-size: 12px;
}

aside.sidebar .user-role {
  color: #81908a;
  font-size: 10px;
}

.user-chevron {
  width: 15px;
  color: #70807a;
}

.user-dropdown {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 64px;
  z-index: 20;
  display: none;
  padding: 6px;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(10, 30, 23, 0.24);
}

.user-dropdown-summary {
  padding: 9px 10px 10px;
  border-bottom: 1px solid #edf0ef;
}

.user-dropdown-summary .dropdown-email {
  color: var(--shell-ink);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-summary .dropdown-tier {
  margin-top: 3px;
  color: var(--shell-muted);
  font-size: 10px;
}

.user-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: #fff;
  color: var(--shell-ink);
  font-size: 11px;
  cursor: pointer;
}

.user-dropdown button:hover {
  background: #f3f5f4;
}

.user-dropdown button.danger {
  color: var(--shell-red);
}

.user-dropdown button svg {
  width: 14px;
}

header.topbar {
  left: 248px;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  justify-content: flex-start;
  z-index: 90;
}

header.topbar .topbar-search {
  width: min(520px, 48vw);
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: #f6f8f7;
  color: #8a9490;
}

header.topbar .topbar-search:focus-within {
  border-color: #8db4a9;
  background: #fff;
}

header.topbar .topbar-search svg {
  width: 16px;
  flex: none;
}

header.topbar .topbar-search input {
  min-width: 0;
  margin: 0 8px;
  color: var(--shell-ink);
}

header.topbar .topbar-search kbd {
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid #d9dfdc;
  border-radius: 4px;
  background: #fff;
  color: #8a9490;
  font-size: 10px;
  text-align: center;
}

header.topbar .topbar-right {
  margin-left: auto;
  gap: 8px;
}

.data-health,
.freshness-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: #fff;
  color: var(--shell-muted);
  font-size: 11px;
  cursor: pointer;
}

.health-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #c18b3c;
  box-shadow: 0 0 0 3px rgba(193, 139, 60, 0.12);
}

.data-health.ready .health-dot,
.freshness-pill.ready .health-dot {
  background: #2d8a67;
  box-shadow: 0 0 0 3px rgba(45, 138, 103, 0.12);
}

.data-health.fallback .health-dot,
.freshness-pill.fallback .health-dot {
  background: var(--shell-amber);
}

.data-health.degraded .health-dot,
.freshness-pill.degraded .health-dot,
.data-health.stale .health-dot,
.freshness-pill.stale .health-dot {
  background: #b7791f;
  box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.13);
}

.data-health.failed .health-dot,
.freshness-pill.failed .health-dot {
  background: #c2413b;
  box-shadow: 0 0 0 3px rgba(194, 65, 59, 0.13);
}

/* Data trust center */
.data-console {
  display: grid;
  gap: 16px;
}

.data-console-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--shell-line);
}

.data-console-head h2 {
  margin: 5px 0 3px;
  color: var(--shell-ink);
  font-size: 20px;
}

.data-console-head p {
  margin: 0;
  color: var(--shell-muted);
  font-size: 12px;
}

.data-quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--shell-line);
  border-radius: 5px;
  background: #fff;
  color: var(--shell-muted);
  font-size: 11px;
  font-weight: 700;
}

.data-quality-badge > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #84918b;
}

.data-quality-badge.healthy { color: #247354; border-color: #b9dacd; background: #f2faf6; }
.data-quality-badge.healthy > span { background: #2d8a67; }
.data-quality-badge.degraded,
.data-quality-badge.not_connected,
.data-quality-badge.stale { color: #8b5a16; border-color: #e6cfa4; background: #fff9ec; }
.data-quality-badge.degraded > span,
.data-quality-badge.not_connected > span,
.data-quality-badge.stale > span { background: #b7791f; }
.data-quality-badge.failed { color: #a33833; border-color: #e5bbb8; background: #fff5f4; }
.data-quality-badge.failed > span { background: #c2413b; }

.data-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: #fff;
}

.data-summary-grid > div {
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid var(--shell-line);
  border-bottom: 1px solid var(--shell-line);
}

.data-summary-grid > div:nth-child(3n) { border-right: 0; }
.data-summary-grid > div:nth-last-child(-n + 3) { border-bottom: 0; }
.data-summary-grid span,
.data-summary-grid small { display: block; color: var(--shell-muted); font-size: 11px; }
.data-summary-grid strong { display: block; margin: 3px 0 1px; color: var(--shell-ink); font: 700 23px/1.1 'DM Mono', monospace; }

.data-pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #d9e4df;
  border-radius: 6px;
  background: #f7faf8;
}

.data-pipeline > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.data-pipeline > div > svg { width: 17px; color: #387861; }
.data-pipeline > svg { width: 15px; color: #a0aaa5; }
.data-pipeline b,
.data-pipeline small { display: block; }
.data-pipeline b { color: var(--shell-ink); font-size: 12px; }
.data-pipeline small { color: var(--shell-muted); font-size: 10px; }

.data-quality-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: #fff;
}

.data-quality-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-quality-table th { padding: 9px 12px; border-bottom: 1px solid var(--shell-line); background: #f7f9f8; color: var(--shell-muted); font-size: 10px; font-weight: 700; text-align: left; }
.data-quality-table td { padding: 10px 12px; border-bottom: 1px solid #edf0ee; color: #43504b; font-size: 11px; vertical-align: middle; }
.data-quality-table tr:last-child td { border-bottom: 0; }
.data-quality-table th:nth-child(1) { width: 16%; }
.data-quality-table th:nth-child(2) { width: 11%; }
.data-quality-table th:nth-child(3) { width: 10%; }
.data-quality-table th:nth-child(4) { width: 12%; }
.data-quality-table th:nth-child(5) { width: 10%; }
.data-quality-table th:nth-child(6) { width: 10%; }
.data-quality-table th:nth-child(7) { width: 14%; }
.data-quality-table th:nth-child(8) { width: 17%; }
.data-quality-name { color: var(--shell-ink); font-weight: 700; }
.data-quality-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.data-quality-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #2d8a67; }
.data-quality-state.degraded,
.data-quality-state.not_connected,
.data-quality-state.stale { color: #8b5a16; }
.data-quality-state.degraded::before,
.data-quality-state.not_connected::before,
.data-quality-state.stale::before { background: #b7791f; }
.data-quality-state.failed { color: #a33833; }
.data-quality-state.failed::before { background: #c2413b; }
.data-quality-empty { height: 80px; color: var(--shell-muted) !important; text-align: center; }

.data-issue-band {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 16px;
  padding: 13px 15px;
  border-left: 3px solid #b7791f;
  background: #fff9ec;
}

.data-issue-band > div { display: flex; align-items: center; gap: 7px; color: #8b5a16; }
.data-issue-band svg { width: 16px; }
.data-issue-band h3 { margin: 0; font-size: 12px; }
.data-issue-band ul { display: flex; flex-wrap: wrap; gap: 5px 20px; margin: 0; padding-left: 17px; color: #6d5839; font-size: 11px; line-height: 1.6; }
.data-issue-band.healthy { border-left-color: #2d8a67; background: #f2faf6; }
.data-issue-band.healthy > div { color: #247354; }
.data-issue-band.failed { border-left-color: #c2413b; background: #fff5f4; }
.data-issue-band.failed > div { color: #a33833; }

header.topbar .topbar-icon {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #59645f;
}

header.topbar .topbar-icon:hover {
  border-color: var(--shell-line);
  background: #f6f8f7;
}

header.topbar .topbar-icon svg {
  width: 18px;
}

.mobile-user {
  display: none !important;
}

main {
  margin-left: 248px;
  min-width: 0;
  padding: 94px 32px 50px;
  position: static;
  z-index: auto;
}

main > .page-head,
main > .page {
  width: min(1320px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.page-head {
  margin-bottom: 20px;
}

.page-head .eyebrow {
  margin-bottom: 5px;
  color: #84908b;
  font-family: inherit;
  font-size: 10px;
}

.page-head h1 {
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
}

/* Overview */
.decision-workspace {
  display: grid;
  gap: 18px;
}

.workspace-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 0 4px;
}

.workspace-kicker,
.section-label {
  color: var(--shell-primary);
}

.workspace-intro h2 {
  margin: 7px 0 5px;
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 20px;
}

.workspace-intro p:last-child {
  margin: 0;
  color: var(--shell-muted);
  font-size: 12px;
}

.workspace-intro-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ov-market-scope-picker {
  position: relative;
}

.market-switcher {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: #fff;
  color: var(--shell-ink);
  cursor: pointer;
}

.market-switcher b {
  font-size: 11px;
}

.market-switcher svg {
  width: 14px;
  color: var(--shell-muted);
}

.ov-market-scope-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 7px);
  right: 0;
  width: min(330px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--shell-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(19, 45, 37, 0.14);
}

.ov-market-scope-menu[hidden] {
  display: none;
}

.ov-market-scope-menu-head,
.ov-market-scope-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ov-market-scope-menu-head strong {
  color: var(--shell-ink);
  font-size: 12px;
}

.ov-market-scope-menu-head span {
  color: var(--shell-muted);
  font-size: 10px;
}

.ov-market-scope-options {
  display: grid;
  gap: 5px;
  max-height: 280px;
  margin: 10px 0;
  overflow-y: auto;
}

.ov-market-scope-options label {
  display: grid;
  grid-template-columns: 16px 24px 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}

.ov-market-scope-options label:hover {
  border-color: var(--shell-line);
  background: #f8faf9;
}

.ov-market-scope-options .flag {
  font-size: 18px;
}

.ov-market-scope-options b,
.ov-market-scope-options small {
  display: block;
}

.ov-market-scope-options b {
  color: var(--shell-ink);
  font-size: 11px;
}

.ov-market-scope-options small {
  margin-top: 2px;
  color: var(--shell-muted);
  font-size: 9px;
}

.ov-market-scope-actions {
  padding-top: 9px;
  border-top: 1px solid var(--shell-line);
}

.ov-market-scope-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--shell-line);
  border-radius: 5px;
  background: #fff;
  color: var(--shell-muted);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.ov-market-scope-actions button.primary {
  border-color: var(--shell-primary);
  background: var(--shell-primary);
  color: #fff;
}

.ov-scope-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 0;
  border-top: 1px solid var(--shell-line);
  border-bottom: 1px solid var(--shell-line);
}

.ov-scope-summary > span,
.ov-scope-summary > button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 0;
  border-radius: 4px;
  background: #eef3f1;
  color: #52625c;
  font: inherit;
  font-size: 9px;
}

.ov-scope-summary > button {
  cursor: pointer;
}

.ov-scope-summary svg {
  width: 12px;
  height: 12px;
}

.ov-scope-summary .is-healthy { background: var(--shell-primary-soft); color: var(--shell-primary); }
.ov-scope-summary .is-degraded,
.ov-scope-summary .is-stale { background: var(--shell-amber-soft); color: #8a5a17; }
.ov-scope-summary .is-failed { background: var(--shell-red-soft); color: var(--shell-red); }

.decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
  gap: 16px;
}

.decision-query,
.today-signals,
.dashboard-panel {
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: var(--shell-card);
}

.decision-query {
  padding: 22px;
}

.today-signals {
  padding: 18px;
}

.decision-card-head,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.decision-card-head h3,
.panel-heading h3 {
  margin: 4px 0 0;
  color: var(--shell-ink);
  font-size: 15px;
}

.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
  font-size: 10px;
  white-space: nowrap;
}

.evidence-badge svg {
  width: 13px;
}

.ov-hero-input-wrap {
  position: relative;
  width: 100% !important;
  margin-top: 18px;
  border: 1px solid #cfd8d4;
  border-radius: 7px;
  background: #fbfcfc;
}

.ov-hero-input-wrap:focus-within {
  border-color: #7cae9f;
  box-shadow: 0 0 0 3px rgba(23, 107, 85, 0.09);
}

.ov-hero-input-wrap textarea {
  width: 100%;
  min-height: 96px;
  padding: 14px 58px 14px 14px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--shell-ink);
  font-size: 13px;
  line-height: 1.7;
}

#ov-hero-send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: var(--shell-primary);
  color: #fff;
  cursor: pointer;
}

#ov-hero-send svg {
  width: 18px;
}

.ov-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.ov-hero-chips button {
  padding: 5px 9px;
  border: 1px solid var(--shell-line);
  border-radius: 5px;
  background: #fff;
  color: var(--shell-muted);
  font-size: 10px;
  cursor: pointer;
}

.ov-hero-chips button:hover {
  border-color: #8fb6ab;
  color: var(--shell-primary);
}

.ov-hero-result {
  margin-top: 14px;
}

.icon-command {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--shell-line);
  border-radius: 5px;
  background: #fff;
  color: var(--shell-muted);
  cursor: pointer;
}

.icon-command svg {
  width: 15px;
}

.signal-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  margin-top: 0;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid #edf0ef;
  border-radius: 0;
  background: #fff;
  color: var(--shell-ink);
  text-align: left;
  cursor: pointer;
}

.signal-item:hover {
  background: #fafbfb;
}

.signal-level {
  grid-row: 1 / span 2;
  align-self: start;
  min-width: 42px;
  padding: 3px 5px;
  border-radius: 4px;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
}

.signal-item.risk .signal-level {
  background: var(--shell-red-soft);
  color: var(--shell-red);
}

.signal-item.opportunity .signal-level {
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

.signal-item.neutral .signal-level {
  background: var(--shell-blue-soft);
  color: var(--shell-blue);
}

.signal-item strong,
.signal-item small {
  min-width: 0;
}

.signal-item strong {
  font-size: 11px;
}

.signal-item small {
  color: var(--shell-muted);
  font-size: 9px;
}

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

.ov-metrics .ov-metric-card {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ov-metrics .ov-metric-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 6px;
  background: var(--shell-primary-soft) !important;
  font-size: 17px;
}

.ov-metrics .ov-metric-icon svg {
  width: 17px;
  height: 17px;
  color: var(--shell-primary);
}

.ov-metrics .ov-metric-info {
  min-width: 0;
  display: block;
}

.ov-metrics .ov-metric-val {
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  animation: none;
}

.ov-metrics .ov-metric-info h3 {
  margin: 2px 0 0;
  color: var(--shell-muted);
  font-size: 10px;
  font-weight: 500;
}

.ov-metrics .ov-metric-sub {
  margin-top: 2px;
  color: #8c9692;
  font-size: 9px;
}

.ov-metrics .ov-metric-open {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: #9ba7a2;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
  gap: 16px;
}

.dashboard-panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading {
  margin-bottom: 14px;
}

.text-command {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
  border: 0;
  background: none;
  color: var(--shell-primary);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.text-command svg {
  width: 13px;
}

.ov-data-table {
  min-width: 0;
  overflow-x: auto;
}

.ov-product-empty {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed var(--shell-line);
  border-radius: 6px;
  background: #fafcfb;
}

.ov-product-empty > svg {
  width: 26px;
  color: var(--shell-primary);
}

.ov-product-empty strong,
.ov-product-empty p {
  display: block;
  margin: 0;
}

.ov-product-empty strong {
  color: var(--shell-ink);
  font-size: 12px;
}

.ov-product-empty p {
  margin-top: 4px;
  color: var(--shell-muted);
  font-size: 9px;
}

.ov-product-empty button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--shell-primary);
  border-radius: 5px;
  background: #fff;
  color: var(--shell-primary);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.ov-data-table-header,
.ov-data-table-row {
  min-width: 700px;
  grid-template-columns: minmax(190px, 1.4fr) 110px 80px 76px 72px 48px !important;
}

.ov-data-table-header {
  color: #7d8984;
}

.ov-data-table-row {
  border-bottom-color: #edf0ef;
}

.action-queue > button {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr 16px;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid #edf0ef;
  background: #fff;
  color: var(--shell-ink);
  text-align: left;
  cursor: pointer;
}

.action-queue > button > span:nth-child(2) {
  min-width: 0;
}

.action-queue > button b,
.action-queue > button small {
  display: block;
}

.action-queue > button b {
  font-size: 11px;
}

.action-queue > button small {
  margin-top: 3px;
  color: var(--shell-muted);
  font-size: 9px;
}

.action-queue > button > svg {
  width: 14px;
  color: #97a19d;
}

.queue-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

.queue-icon.amber {
  background: var(--shell-amber-soft);
  color: var(--shell-amber);
}

.queue-icon.blue {
  background: var(--shell-blue-soft);
  color: var(--shell-blue);
}

.queue-icon svg {
  width: 15px;
}

.stale-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 10px;
  border-radius: 5px;
  background: var(--shell-amber-soft);
  color: #8a5a17;
  font-size: 9px;
  line-height: 1.5;
}

.stale-hint svg {
  width: 13px;
  flex: none;
}

.market-browser {
  overflow: hidden;
}

.market-browser .ov-country-filters,
.market-browser .ov-tag-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.market-browser .ov-region-btn,
.market-browser .ov-tag-btn {
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--shell-line);
  border-radius: 5px;
  background: #fff;
  color: var(--shell-muted);
  font-size: 10px;
}

.market-browser .ov-region-btn.active,
.market-browser .ov-tag-btn.active {
  border-color: var(--shell-primary);
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

.market-browser .ov-country-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.market-browser .ov-ccard {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--shell-line);
  border-radius: 7px;
  box-shadow: none;
}

.market-browser .ov-ccard:nth-child(n + 7) {
  display: none;
}

.market-browser .ov-ccard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.market-browser .ov-ccard-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.market-browser .ov-ccard-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--shell-line);
  border-radius: 5px;
  background: #fff;
  color: var(--shell-muted);
  font: inherit;
  font-size: 9px;
  font-weight: 600;
}

.market-browser .ov-ccard-btn.primary {
  border-color: var(--shell-primary);
  color: var(--shell-primary);
}

.market-browser .ov-ccard-btn svg {
  width: 12px;
  height: 12px;
}

/* Legacy product pages: keep every route inside the same dense workspace. */
main > .page {
  min-width: 0;
}

main > .page.active {
  position: relative;
}

#watchlist,
#countries,
#platforms,
#tools {
  color: var(--shell-ink);
}

/* Watchlist */
#watchlist .wl-header-bar {
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--shell-line);
}

#watchlist .wl-title {
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
}

#watchlist .wl-group-select select,
#watchlist .wl-btn-sm,
#watchlist .wl-time-filter {
  border-color: var(--shell-line);
  border-radius: 6px;
}

#watchlist .wl-toolbar {
  margin: 0 0 14px;
}

#watchlist .wl-time-btn.active {
  background: var(--shell-primary);
}

#watchlist .wl-ai-diagnosis {
  padding: 15px 18px;
  border-color: #cfe0ea;
  border-radius: 7px;
  background: var(--shell-blue-soft);
}

#watchlist .wl-free-hint {
  margin-bottom: 14px;
  border-color: #ecdcbf;
  border-radius: 6px;
  background: var(--shell-amber-soft);
}

#watchlist .wl-alert-banner {
  margin-bottom: 14px;
}

#watchlist .watch-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#watchlist .watch-card,
#watchlist .wl-rec-card,
#watchlist .wl-sum-card,
#watchlist .wl-bar-chart {
  border-color: var(--shell-line);
  border-radius: 8px;
  box-shadow: none;
}

/* Country market */
#countries.active {
  display: block;
}

#countries > .page-header,
/* Platform intelligence */
#platforms .page-header {
  align-items: flex-start;
}

#countries .country-profile-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 8px 6px 11px;
  color: var(--shell-muted);
  background: var(--shell-card);
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  font-size: 11px;
}

#countries .country-profile-picker > svg {
  width: 15px;
  height: 15px;
  color: var(--shell-primary);
}

#countries .country-profile-picker select {
  min-width: 132px;
  padding: 5px 28px 5px 8px;
  color: var(--shell-ink);
  background: var(--shell-soft);
  border: 0;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}

#countries .country-profile-picker select:focus-visible {
  outline: 2px solid var(--shell-primary);
  outline-offset: 1px;
}

#platforms .page-header h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 20px;
}

#platforms .platform-linkage {
  margin-left: 0;
  border-radius: 6px;
}

#platforms .platform-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

#platforms .platform-scope-empty {
  grid-column: 1 / -1;
  padding: 28px 18px;
  color: var(--shell-muted);
  background: var(--shell-card);
  border: 1px dashed var(--shell-line);
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}

#platforms .platform-card {
  min-width: 0;
  padding: 18px;
  border-color: var(--shell-line);
  border-radius: 8px;
  box-shadow: none;
  cursor: default;
}

#platforms .platform-card:hover {
  transform: none;
  border-color: #aac2ba;
  box-shadow: none;
}

#platforms .platform-source-note {
  margin: 0 0 16px;
  color: var(--shell-muted);
  font-size: 12px;
}

#platforms .platform-rule-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--shell-primary-soft);
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  color: var(--shell-muted);
  font-size: 12px;
}

#platforms .platform-rule-status b {
  color: var(--shell-ink);
  font-size: 15px;
}

#platforms .platform-open-rules {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  color: var(--shell-primary);
  font-size: 12px;
  font-weight: 600;
}

#rules .rl-rule-fields-grid {
  margin-top: 8px;
}

#rules .ai-loading-state {
  padding: 12px 14px;
  color: var(--shell-muted);
  font-size: 12px;
  line-height: 1.6;
}

#rules .rl-rule-field.is-missing .val,
#rules .rl-version-empty,
#rules .rl-rule-fields-note {
  color: var(--shell-muted);
  font-weight: 400;
}

#rules .rl-rule-fields-note,
#rules .rl-version-empty {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.6;
}

#rules .rl-version-history {
  display: grid;
  gap: 8px;
}

#rules .rl-version-row {
  padding: 10px 12px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: var(--shell-card);
}

#rules .rl-version-row > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#rules .rl-version-row b {
  color: var(--shell-ink);
  font-size: 12px;
}

#rules .rl-version-row span,
#rules .rl-version-row p {
  color: var(--shell-muted);
  font-size: 11px;
}

#rules .rl-version-row p {
  margin: 5px 0 0;
  line-height: 1.6;
}

#countries .country-scope-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

#countries .country-scope-summary > div {
  min-width: 0;
  padding: 14px;
  background: var(--shell-card);
  border: 1px solid var(--shell-line);
  border-radius: 8px;
}

#countries .country-scope-summary span,
#countries .country-scope-summary small {
  display: block;
  color: var(--shell-muted);
  font-size: 11px;
}

#countries .country-scope-summary b {
  display: block;
  margin: 5px 0 2px;
  color: var(--shell-ink);
  font-size: 22px;
}

#countries .country-commerce-panel {
  margin-top: 22px;
  padding: 20px 0 0;
  border-top: 1px solid var(--shell-line);
}

#countries .country-commerce-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

#countries .country-commerce-heading .eyebrow {
  margin: 0 0 4px;
}

#countries .country-commerce-heading h3 {
  margin: 0;
  color: var(--shell-ink);
  font-size: 17px;
}

#countries .country-commerce-heading > div > p:last-child {
  margin: 6px 0 0;
  color: var(--shell-muted);
  font-size: 11px;
  line-height: 1.6;
}

#countries .country-commerce-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#countries .country-commerce-heading-actions label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--shell-muted);
  font-size: 10px;
}

#countries .country-commerce-heading-actions select {
  min-width: 126px;
  padding: 6px 24px 6px 8px;
  color: var(--shell-ink);
  background: var(--shell-card);
  border: 1px solid var(--shell-line);
  border-radius: 4px;
  font: inherit;
  font-size: 11px;
}

#countries .country-commerce-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--shell-primary);
  background: var(--shell-primary-soft);
  border: 1px solid var(--shell-line);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

#countries .country-commerce-section {
  padding: 18px 0 22px;
  border-top: 1px solid var(--shell-line);
}

#countries .country-commerce-section:first-child {
  padding-top: 0;
  border-top: 0;
}

#countries .country-commerce-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

#countries .country-commerce-section-head h4 {
  margin: 0;
  color: var(--shell-ink);
  font-size: 14px;
}

#countries .country-commerce-section-head p {
  margin: 4px 0 0;
  color: var(--shell-muted);
  font-size: 10px;
}

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

#countries .country-commerce-metric {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 176px;
  padding: 14px;
  background: var(--shell-card);
  border: 1px solid var(--shell-line);
  border-radius: 6px;
}

#countries .country-commerce-metric.is-missing {
  background: transparent;
  border-style: dashed;
}

#countries .country-commerce-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--shell-muted);
  font-size: 9px;
}

#countries .country-commerce-metric-top span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#countries .country-commerce-metric-top time {
  flex: 0 0 auto;
}

#countries .country-commerce-metric-top svg {
  width: 13px;
  height: 13px;
}

#countries .country-commerce-metric h5 {
  margin: 11px 0 0;
  color: var(--shell-ink);
  font-size: 13px;
}

#countries .country-commerce-metric > p {
  min-height: 32px;
  margin: 4px 0 10px;
  color: var(--shell-muted);
  font-size: 10px;
  line-height: 1.55;
}

#countries .country-commerce-metric.is-missing > strong {
  margin-top: auto;
  color: var(--shell-muted);
  font-size: 11px;
  font-weight: 500;
}

#countries .country-commerce-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  margin: auto 0 10px;
}

#countries .country-commerce-value b {
  color: var(--shell-ink);
  font-size: 21px;
  line-height: 1.2;
}

#countries .country-commerce-value span {
  color: var(--shell-muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

#countries .country-commerce-metric a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  color: var(--shell-primary);
  font-size: 10px;
  text-decoration: none;
}

#countries .country-commerce-metric a svg {
  width: 12px;
  height: 12px;
}

#countries .country-commerce-section-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 16px;
  color: var(--shell-muted);
  border: 1px dashed var(--shell-line);
  border-radius: 6px;
}

#countries .country-commerce-section-empty > svg {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--shell-primary);
}

#countries .country-commerce-section-empty strong {
  color: var(--shell-ink);
  font-size: 12px;
}

#countries .country-commerce-section-empty p {
  margin: 4px 0 0;
  font-size: 10px;
}

#countries .country-commerce-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#countries .country-commerce-link-grid button {
  display: grid;
  grid-template-columns: 30px 1fr 16px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  text-align: left;
  color: var(--shell-ink);
  background: var(--shell-card);
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  cursor: pointer;
}

#countries .country-commerce-link-grid button > svg:first-child {
  width: 20px;
  color: var(--shell-primary);
}

#countries .country-commerce-link-grid button > svg:last-child {
  width: 14px;
  color: var(--shell-muted);
}

#countries .country-commerce-link-grid span,
#countries .country-commerce-link-grid small {
  display: block;
  min-width: 0;
}

#countries .country-commerce-link-grid b {
  font-size: 11px;
}

#countries .country-commerce-link-grid small {
  margin-top: 3px;
  color: var(--shell-muted);
  font-size: 9px;
}

#countries .country-commerce-background {
  margin-top: 2px;
  border-top: 1px solid var(--shell-line);
  border-bottom: 1px solid var(--shell-line);
}

#countries .country-commerce-background summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}

#countries .country-commerce-background summary::-webkit-details-marker {
  display: none;
}

#countries .country-commerce-background summary span,
#countries .country-commerce-background summary small {
  display: block;
}

#countries .country-commerce-background summary b {
  color: var(--shell-ink);
  font-size: 12px;
}

#countries .country-commerce-background summary small {
  margin-top: 3px;
  color: var(--shell-muted);
  font-size: 9px;
}

#countries .country-commerce-background summary svg {
  width: 15px;
  transition: transform .2s ease;
}

#countries .country-commerce-background[open] summary svg {
  transform: rotate(180deg);
}

#countries .country-commerce-background-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 0 14px;
}

#countries .country-commerce-background-grid > div {
  padding: 10px;
  background: var(--shell-card);
  border: 1px solid var(--shell-line);
  border-radius: 4px;
}

#countries .country-commerce-background-grid span,
#countries .country-commerce-background-grid b,
#countries .country-commerce-background-grid time {
  display: block;
}

#countries .country-commerce-background-grid span,
#countries .country-commerce-background-grid time,
#countries .country-commerce-background-grid small {
  color: var(--shell-muted);
  font-size: 9px;
}

#countries .country-commerce-background-grid b {
  margin: 5px 0;
  color: var(--shell-ink);
  font-size: 13px;
}

#countries .country-commerce-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 38px 20px;
  text-align: center;
  color: var(--shell-muted);
  border: 1px dashed var(--shell-line);
  border-radius: 6px;
  background: var(--shell-card);
}

#countries .country-commerce-empty svg {
  width: 32px;
  height: 32px;
  margin-bottom: 10px;
  color: var(--shell-primary);
}

#countries .country-commerce-empty strong {
  color: var(--shell-ink);
  font-size: 14px;
}

#countries .country-commerce-empty p {
  max-width: 560px;
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.7;
}

#countries .country-commerce-panel.is-loading .country-commerce-empty svg {
  animation: jay-commerce-spin 1.1s linear infinite;
}

@keyframes jay-commerce-spin {
  to { transform: rotate(360deg); }
}

#countries .country-data-empty,
.resource-empty-state {
  padding: 52px 24px;
  text-align: center;
  color: var(--shell-muted);
  border: 1px dashed var(--shell-line);
  border-radius: 8px;
  background: var(--shell-card);
}

#countries .country-data-empty svg,
.resource-empty-state svg {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  color: var(--shell-primary);
}

#countries .country-data-empty h3,
.resource-empty-state h3 {
  margin: 0;
  color: var(--shell-ink);
  font-size: 16px;
}

#countries .country-data-empty p,
.resource-empty-state p {
  max-width: 520px;
  margin: 8px auto 0;
  font-size: 12px;
  line-height: 1.7;
}

/* Resource center */
#content .resource-page-header { align-items: flex-end; }
#content .resource-page-header p { margin: 6px 0 0; color: var(--shell-muted); font-size: 12px; }
#content .resource-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0 16px; }
#content .resource-nav-item { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 11px; align-items: center; min-height: 72px; padding: 13px 15px; text-align: left; color: var(--shell-muted); background: var(--shell-card); border: 1px solid var(--shell-line); border-radius: 8px; cursor: pointer; }
#content .resource-nav-item svg { grid-row: 1 / span 2; width: 21px; height: 21px; color: var(--shell-primary); }
#content .resource-nav-item span { color: var(--shell-ink); font-size: 14px; font-weight: 700; }
#content .resource-nav-item small { margin-top: 3px; font-size: 11px; line-height: 1.5; }
#content .resource-nav-item.is-active { border-color: var(--shell-primary); box-shadow: inset 0 -2px 0 var(--shell-primary); }
#content .resource-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 24px; }
#content .resource-search { display: flex; flex: 1 1 260px; align-items: center; gap: 8px; min-height: 38px; padding: 0 11px; border: 1px solid var(--shell-line); border-radius: 6px; background: var(--shell-card); }
#content .resource-search svg { width: 16px; color: var(--shell-muted); }
#content .resource-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--shell-ink); font: inherit; }
#content .resource-toolbar select, #content .resource-toolbar > input { height: 38px; min-width: 110px; padding: 0 10px; border: 1px solid var(--shell-line); border-radius: 6px; background: var(--shell-card); color: var(--shell-ink); font: 12px inherit; }
#content .resource-catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
#content .resource-catalog-head h3 { margin: 0; font-size: 18px; }
#content .resource-catalog-head span { color: var(--shell-muted); font-size: 11px; }
#content .resource-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#content .resource-card { min-width: 0; padding: 17px; border: 1px solid var(--shell-line); border-radius: 8px; background: var(--shell-card); }
#content .resource-card-top, #content .resource-card-meta, #content .resource-card-actions { display: flex; align-items: center; gap: 8px; }
#content .resource-card-top { justify-content: space-between; }
#content .resource-type, #content .resource-status { font-size: 10px; }
#content .resource-type { color: var(--shell-primary); font-weight: 700; }
#content .resource-status { color: var(--shell-muted); }
#content .resource-status.published { color: #23845d; }
#content .resource-card h4 { margin: 14px 0 6px; font-size: 15px; line-height: 1.45; }
#content .resource-card > p { min-height: 40px; margin: 0; color: var(--shell-muted); font-size: 12px; line-height: 1.7; }
#content .resource-card-meta { flex-wrap: wrap; margin-top: 14px; color: var(--shell-muted); font-size: 10px; }
#content .resource-card-meta span + span::before { content: '·'; margin-right: 8px; color: var(--shell-line); }
#content .resource-card-actions { flex-wrap: wrap; margin-top: 15px; }
#content .resource-card-action { padding: 5px 8px; border: 1px solid var(--shell-line); border-radius: 4px; background: transparent; color: var(--shell-primary); font: 11px inherit; cursor: pointer; }
#content .resource-card-action:hover { background: var(--shell-soft); }
#content .resource-lock { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; color: var(--shell-muted); font-size: 10px; }
#content .resource-lock svg { width: 12px; height: 12px; }
#content .resource-admin-panel, #content .resource-detail { margin: 18px 0 24px; padding: 19px; border: 1px solid var(--shell-line); border-radius: 8px; background: var(--shell-card); }
#content .resource-admin-head, #content .resource-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
#content .resource-detail-actions { display: flex; align-items: center; gap: 8px; flex: none; }
#content .resource-admin-head h3, #content .resource-detail-head h3 { margin: 4px 0 0; font-size: 17px; }
#content .resource-admin-head p { margin: 7px 0 0; color: var(--shell-muted); font-size: 12px; line-height: 1.6; }
#content .resource-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
#content .resource-admin-form label { display: grid; gap: 5px; color: var(--shell-muted); font-size: 11px; }
#content .resource-admin-form input, #content .resource-admin-form select, #content .resource-admin-form textarea { width: 100%; padding: 8px 9px; border: 1px solid var(--shell-line); border-radius: 5px; background: var(--shell-bg); color: var(--shell-ink); font: 12px inherit; }
#content .resource-form-wide { margin-top: 10px; }
#content .resource-admin-actions { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
#content .resource-admin-actions span { color: var(--shell-muted); font-size: 11px; }
#content .resource-detail-head p { margin: 7px 0 0; color: var(--shell-muted); font-size: 12px; line-height: 1.7; }
#content .resource-detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 20px; color: var(--shell-muted); font-size: 11px; }
#content .resource-detail h4 { margin: 16px 0 8px; font-size: 13px; }
#content .resource-version-list, #content .resource-file-list { display: grid; gap: 7px; }
#content .resource-version-list > div, #content .resource-file-list > div { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--shell-line); border-radius: 5px; font-size: 11px; }
#content .resource-version-list span { color: var(--shell-ink); }
#content .resource-version-list small { margin-left: auto; color: var(--shell-muted); }
#content .resource-progress { margin: 12px 0 2px; padding-top: 10px; border-top: 1px solid var(--shell-line); }
#content .resource-progress-head { display: flex; justify-content: space-between; color: var(--shell-muted); font-size: 10px; }
#content .resource-progress-head b { color: var(--shell-ink); font: 700 11px 'DM Mono', monospace; }
#content .resource-progress-track { height: 5px; margin: 6px 0 8px; overflow: hidden; border-radius: 3px; background: #e7eeeb; }
#content .resource-progress-track i { display: block; height: 100%; border-radius: inherit; background: #2d8a67; transition: width .2s ease; }
#content .resource-progress .resource-card-action { min-height: 25px; padding: 0 8px; }
#content .academy-course-actions { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; }
#content .academy-enrollment-state { margin-right: auto; color: var(--shell-muted); font-size: 11px; }
#content .academy-module { margin-top: 14px; border: 1px solid var(--shell-line); border-radius: 6px; background: #fff; }
#content .academy-module-head { display: flex; justify-content: space-between; gap: 14px; padding: 13px 14px 10px; border-bottom: 1px solid var(--shell-line); background: #f7faf8; }
#content .academy-module-head strong { color: var(--shell-ink); font-size: 12px; }
#content .academy-module-head p { margin: 5px 0 0; color: var(--shell-muted); font-size: 11px; }
#content .academy-order-actions { display: flex; gap: 4px; }
#content .academy-order-actions .icon-btn, #content .academy-lesson-meta .icon-btn { width: 27px; height: 27px; }
#content .academy-lesson-list { display: grid; gap: 0; }
#content .academy-lesson { padding: 11px 14px; border-bottom: 1px solid #edf0ee; }
#content .academy-lesson:last-child { border-bottom: 0; }
#content .academy-lesson-main { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
#content .academy-lesson-main strong { color: var(--shell-ink); font-size: 12px; }
#content .academy-lesson-main p { margin: 4px 0 0; color: var(--shell-muted); font-size: 11px; line-height: 1.5; }
#content .academy-lesson-resources { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 52px; }
#content .academy-lesson-resources .resource-card-action { display: inline-flex; align-items: center; gap: 4px; }
#content .academy-lesson-resources svg { width: 12px; height: 12px; }
#content .academy-lesson-type { flex: none; padding: 3px 6px; border: 1px solid #cbdcd4; border-radius: 4px; color: #2d765d; font-size: 10px; }
#content .academy-lesson-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 9px 0 0 52px; color: var(--shell-muted); font-size: 10px; }
#content .academy-lesson-progress-track { width: 90px; height: 4px; overflow: hidden; border-radius: 2px; background: #e7eeeb; }
#content .academy-lesson-progress-track i { display: block; height: 100%; border-radius: inherit; background: #2d8a67; }
#content .academy-video-upload, #content .academy-material-upload { display: inline-flex; align-items: center; min-height: 27px; padding: 0 8px; border: 1px dashed #b7c8c0; border-radius: 5px; color: var(--shell-muted); font-size: 10px; cursor: pointer; }
#content .academy-video-upload:hover, #content .academy-material-upload:hover { border-color: #2d8a67; color: #226c51; background: #f3f9f6; }
#content .academy-video-upload input, #content .academy-material-upload input { display: none; }
#content .academy-empty { margin: 0; padding: 14px; color: var(--shell-muted); font-size: 11px; }
#content .academy-instructor { display: block; margin-top: 8px; color: var(--shell-muted); font-size: 10px; }
#content .academy-player { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--shell-line); }
#content .academy-player-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
#content .academy-player-head > div { display: grid; gap: 3px; }
#content .academy-player-head strong { color: var(--shell-ink); font-size: 13px; }
#content .academy-player-head span { color: var(--shell-muted); font-size: 10px; }
#content .academy-player video { display: block; width: 100%; max-height: 68vh; aspect-ratio: 16 / 9; border-radius: 6px; background: #111613; }
#content .academy-qa { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--shell-line); }
#content .academy-qa > div > strong { color: var(--shell-ink); font-size: 13px; }
#content .academy-qa > div > p { margin: 4px 0 10px; color: var(--shell-muted); font-size: 11px; }
#content .academy-qa form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
#content .academy-qa textarea { width: 100%; min-height: 58px; padding: 9px 10px; border: 1px solid var(--shell-line); border-radius: 5px; resize: vertical; color: var(--shell-ink); font: 12px/1.6 inherit; }
#content .academy-answer { margin-top: 10px; color: var(--shell-ink); font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
#content .resource-file-list > div { justify-content: space-between; }
#content .resource-detail-loading { color: var(--shell-muted); font-size: 12px; }
@media (max-width: 900px) { #content .resource-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } #content .resource-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { #content .resource-nav, #content .resource-list { grid-template-columns: 1fr; } #content .resource-toolbar > select, #content .resource-toolbar > input { flex: 1 1 120px; } #content .resource-form-grid, #content .academy-qa form { grid-template-columns: 1fr; } #content .resource-version-list small { display: none; } #content .academy-course-actions { align-items: stretch; flex-direction: column; } #content .academy-lesson-meta { margin-left: 0; } }

#platforms .platform-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

#platforms .platform-meta-item {
  min-width: 0;
  border-color: var(--shell-line);
  border-radius: 6px;
}

#platforms .platform-meta-item b {
  overflow-wrap: anywhere;
}

#platforms .other-platforms {
  border-color: var(--shell-line);
  border-radius: 8px;
  box-shadow: none;
}

/* Operating calculators */
.tools-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--shell-line);
}

.tools-intro h2 {
  margin: 5px 0 4px;
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 18px;
}

.tools-intro p:last-child {
  margin: 0;
  color: var(--shell-muted);
  font-size: 12px;
}

#tools .tools-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

#tools .tools-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.tools-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 14px;
}

.tools-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 6px;
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

.tools-card-icon.blue {
  background: var(--shell-blue-soft);
  color: var(--shell-blue);
}

.tools-card-icon.amber {
  background: var(--shell-amber-soft);
  color: var(--shell-amber);
}

.tools-card-icon svg {
  width: 17px;
}

#tools .tools-card h3 {
  margin: 0 0 3px;
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 14px;
}

#tools .tools-card .t-sub {
  margin: 0;
  color: var(--shell-muted);
  font-size: 10px;
  line-height: 1.5;
}

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

#tools .tools-field {
  min-width: 0;
  margin: 0;
}

#tools .tools-field-wide {
  grid-column: 1 / -1;
}

#tools .tools-field label {
  margin-bottom: 5px;
  color: var(--shell-muted);
  font-size: 10px;
}

#tools .tools-field input,
#tools .tools-field select {
  min-height: 38px;
  border-color: var(--shell-line);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--shell-ink);
  font-size: 12px;
}

#tools .tools-field input:focus,
#tools .tools-field select:focus {
  border-color: #7cae9f;
  box-shadow: 0 0 0 3px rgba(23, 107, 85, 0.08);
}

#tools .tools-res {
  min-height: 176px;
  margin-top: 16px;
  padding-top: 12px;
  border-top-color: var(--shell-line);
}

#tools .tools-res .row {
  padding: 5px 0;
  color: var(--shell-muted);
  font-size: 11px;
}

#tools .tools-res .row b {
  color: var(--shell-ink);
}

#tools .tools-res .row.hl {
  font-size: 13px;
}

#tools .tools-res .pos {
  color: var(--shell-primary);
}

#tools .tools-res .neg {
  color: var(--shell-red);
}

#tools .tools-dim {
  color: var(--shell-muted);
}

#tools .tools-bar {
  background: #edf1ef;
}

#tools .tools-bar > i {
  background: var(--shell-primary);
}

#tools .tools-badge {
  border-radius: 5px;
}

#tools .tools-badge.good {
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

#tools .tools-badge.warn {
  background: var(--shell-amber-soft);
  color: var(--shell-amber);
}

#tools .tools-badge.bad {
  background: var(--shell-red-soft);
  color: var(--shell-red);
}

.toast {
  z-index: 3100;
}

.jay-fb-float {
  display: none !important;
}

.st-service-status {
  min-height: 42px;
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: #f8faf9;
}

.st-service-status .health-dot {
  grid-row: 1 / span 2;
}

.st-service-status b,
.st-service-status small {
  display: block;
}

.st-service-status b {
  color: var(--shell-ink);
  font-size: 11px;
}

.st-service-status small {
  color: var(--shell-muted);
  font-size: 9px;
}

@media (max-width: 1100px) {
  .decision-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .market-browser .ov-country-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #countries.active {
    grid-template-columns: 1fr;
  }

  #countries .country-commerce-grid,
  #countries .country-commerce-background-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #tools .tools-grid {
    grid-template-columns: 1fr;
  }
}

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

  .login-product {
    min-height: auto;
    padding: 28px 24px 32px;
  }

  .login-product-copy {
    margin: 42px 0 0;
  }

  .login-product-copy h1 {
    font-size: 32px;
  }

  .login-source-note {
    display: none;
  }

  .login-auth {
    min-height: auto;
    padding: 40px 24px 56px;
  }

  body aside.sidebar {
    width: 248px;
    transform: translateX(-100%);
  }

  body aside.sidebar.open {
    transform: none;
    z-index: 110;
  }

  header.topbar {
    left: 0;
    min-height: 64px;
    padding: 8px 14px 8px 70px;
  }

  header.topbar .topbar-search {
    width: min(480px, calc(100vw - 190px));
  }

  .data-health {
    display: none;
  }

  .mobile-user {
    display: grid !important;
  }

  main {
    margin-left: 0;
    padding: 88px 16px 38px;
  }

  #jay-hamburger {
    top: 11px;
    left: 12px;
    width: 40px;
    height: 40px;
    z-index: 120;
  }

  #jay-overlay.show {
    z-index: 105;
  }
}

@media (max-width: 640px) {
  .login-proof-grid {
    grid-template-columns: 1fr;
  }

  .login-proof-grid div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
  }

  .login-proof-grid strong {
    font-size: 19px;
  }

  header.topbar .topbar-search {
    width: calc(100vw - 142px);
  }

  header.topbar .topbar-search kbd {
    display: none;
  }

  main {
    padding: 84px 12px 32px;
  }

  .page-head h1 {
    font-size: 21px;
  }

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

  .workspace-intro-actions {
    width: 100%;
  }

  .ov-market-scope-picker {
    flex: 1;
    min-width: 0;
  }

  .market-switcher,
  .freshness-pill {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .freshness-pill span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .data-console-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .data-summary-grid { grid-template-columns: 1fr 1fr; }
  .data-summary-grid > div { border-right: 1px solid var(--shell-line); border-bottom: 1px solid var(--shell-line); }
  .data-summary-grid > div:nth-child(2n) { border-right: 0; }
  .data-summary-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .data-pipeline { grid-template-columns: 1fr 1fr; gap: 9px 14px; }
  .data-pipeline > svg { display: none; }
  .data-quality-table { min-width: 860px; }
  .data-issue-band { grid-template-columns: 1fr; gap: 7px; }

  .decision-query,
  .today-signals,
  .dashboard-panel {
    padding: 14px;
  }

  .decision-card-head {
    align-items: flex-start;
  }

  .evidence-badge {
    padding: 4px 6px;
  }

  .ov-hero-input-wrap textarea {
    min-height: 118px;
  }

  .ov-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .ov-metrics .ov-metric-card {
    min-height: 82px;
    padding: 11px;
  }

  .ov-metrics .ov-metric-icon {
    width: 31px;
    height: 31px;
  }

  .ov-product-empty {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .ov-product-empty button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .market-browser .ov-ccard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-browser .ov-ccard-btn.primary {
    grid-column: 1 / -1;
  }

  .market-browser .ov-country-grid {
    grid-template-columns: 1fr;
  }

  .market-browser .ov-ccard:nth-child(n + 5) {
    display: none;
  }

  #countries > .page-header,
  #countries .country-commerce-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #countries .country-profile-picker {
    width: 100%;
  }

  #countries .country-profile-picker select {
    flex: 1;
    min-width: 0;
  }

  #countries .country-scope-summary,
  #countries .country-commerce-grid,
  #countries .country-commerce-link-grid,
  #countries .country-commerce-background-grid {
    grid-template-columns: 1fr;
  }

  #countries .country-commerce-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #countries .country-commerce-heading-actions label,
  #countries .country-commerce-heading-actions select {
    width: 100%;
  }

  #countries .country-commerce-count {
    align-self: flex-start;
  }

  #watchlist .wl-header-bar,
  .tools-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  #watchlist .wl-header-right,
  #watchlist .wl-header-right .export {
    width: 100%;
  }

  #watchlist .watch-grid,
  #platforms .platform-grid,
  #platforms .platform-meta,
  .tools-form-grid {
    grid-template-columns: 1fr;
  }

  #countries .metric-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #countries .metric-card {
    padding: 14px;
  }

  #countries .metric-value {
    font-size: 22px;
  }

  #tools .tools-field-wide {
    grid-column: auto;
  }

  .jay-fb-float {
    display: none !important;
  }
}
