:root {
  font-family: "PingFang SC", "Microsoft YaHei", Inter, system-ui, sans-serif;
  color: #152743;
  background: #f3f7fc;
  font-synthesis: none;
  --blue: #164ab9;
  --muted: #566881;
  --line: #dce6f3;
  --teal: #087b74;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--blue);
}
button,
select,
input {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #148bdb;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.04em;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 15px;
}
small,
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.loading {
  padding: 32px;
}
.error {
  color: #a22b37;
  background: #fff0f0;
  border-radius: 8px;
  padding: 10px 14px;
}
.layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: #102744;
  color: #e8f1ff;
  display: flex;
  flex-direction: column;
  padding: 24px 15px;
}
.side nav {
  display: grid;
  gap: 5px;
  margin-top: 30px;
}
.side .brandmark {
  background: white;
  border-radius: 10px;
  padding: 8px 11px;
  max-width: 172px;
  display: block;
}
.brandmark img {
  display: block;
  width: 126px;
  height: 35px;
  object-position: left;
  object-fit: contain;
}
.side nav a,
.side button {
  color: inherit;
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 8px;
  text-align: left;
}
.side nav a[aria-current] {
  background: #244b74;
  color: white;
  font-weight: 650;
}
.side nav a:hover {
  background: #1b3b60;
}
.side button {
  border: 0;
  background: transparent;
  margin-top: auto;
}
.workspace {
  min-width: 0;
  width: min(100%, 1440px);
  padding: 35px clamp(18px, 3.1vw, 49px) 50px;
  margin: auto;
  margin-top: 0;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 24px;
}
.header p {
  margin-top: 7px;
}
.selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
select,
input {
  border: 1px solid #bccee2;
  border-radius: 8px;
  background: white;
  padding: 9px 11px;
  color: #172b48;
  max-width: 100%;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 19px;
  min-width: 0;
}
.stack {
  display: grid;
  gap: 16px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hero {
  background: #122e57;
  color: #f4f8ff;
  border: 0;
  padding: 25px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 20px;
  align-items: center;
}
.hero .muted {
  color: #c6d7f2;
}
.hero .metric {
  font-size: 56px;
  font-weight: 670;
  line-height: 1.12;
  color: #fff;
  letter-spacing: -0.06em;
}
.hero .metric small {
  color: #d8e8ff;
  margin-left: 5px;
  letter-spacing: 0;
}
.pill {
  display: inline-block;
  font-size: 12px;
  border-radius: 30px;
  padding: 5px 10px;
  background: #e9f2ff;
  color: #194779;
}
.hero .pill {
  background: #234973;
  color: #e7f3ff;
}
.hero-right {
  padding-left: 20px;
  border-left: 1px solid #496485;
  display: grid;
  gap: 8px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat strong {
  display: block;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
}
.trend-bars {
  align-items: flex-end;
  display: flex;
  gap: 8px;
  overflow: auto;
  margin: 18px 0 5px;
  min-height: 140px;
}
.trend-item {
  min-width: 59px;
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}
.trend-item meter {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 17px;
  height: 92px;
  accent-color: #2357bc;
}
.trend-item small {
  white-space: nowrap;
}
.model-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.model-card {
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding: 13px;
  border-radius: 10px;
}
.model-card:hover {
  border-color: #4c7dbd;
}
.model-card strong {
  font-size: 21px;
}
.scroll {
  overflow: auto;
}
.matrix {
  border-collapse: collapse;
  width: 100%;
  margin-top: 10px;
  text-align: left;
}
.matrix th,
.matrix td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.matrix th:first-child,
.matrix td:first-child {
  min-width: 180px;
  white-space: normal;
}
.state-good {
  color: var(--teal);
}
.state-bad {
  color: #a22b37;
}
.primary {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 9px 13px;
  text-decoration: none;
  display: inline-block;
}
.secondary {
  border: 1px solid #cad9ec;
  background: #fff;
  color: var(--blue);
  border-radius: 8px;
  padding: 8px 11px;
  text-decoration: none;
}
.empty {
  padding: 38px 18px;
  text-align: center;
}
.empty p {
  margin-top: 7px;
}
.model-actions {
  display: flex;
  overflow: auto;
  gap: 8px;
  padding-bottom: 2px;
}
.model-actions a {
  white-space: nowrap;
}
.model-actions a[aria-current] {
  background: #e5effe;
  font-weight: 700;
}
.question-list details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.question-list details:first-child {
  border-top: 0;
}
.question-list summary {
  cursor: pointer;
  line-height: 1.5;
  font-weight: 600;
}
.question-list pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  background: #f5f8fc;
  padding: 16px;
  border-radius: 8px;
  line-height: 1.7;
}
.question-list ul {
  overflow-wrap: anywhere;
}
.question-list .muted {
  margin: 5px 0;
}
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.auth-card {
  width: min(100%, 444px);
  padding: 30px;
  display: grid;
  gap: 16px;
}
.auth-card form,
.auth-card label {
  display: grid;
  gap: 8px;
}
.auth-card form {
  gap: 15px;
}
.auth-card a {
  font-size: 14px;
}
.field-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  margin: 8px 0;
}
.field-grid div {
  display: grid;
  gap: 4px;
}
.delta {
  font-weight: 650;
  color: #61e6cf;
}
.delta.down {
  color: #ffc1c5;
}
@media (max-width: 850px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .side {
    height: auto;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 8px 9px env(safe-area-inset-bottom);
    display: block;
  }
  .side .brandmark,
  .side button {
    display: none;
  }
  .side nav {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    text-align: center;
  }
  .side nav a {
    text-align: center;
    padding: 11px 2px;
    font-size: 13px;
  }
  .workspace {
    padding: 19px 13px 77px;
  }
  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 15px;
  }
  .card {
    padding: 15px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-right {
    padding-left: 0;
    padding-top: 12px;
    border-left: 0;
    border-top: 1px solid #496485;
  }
  .hero .metric {
    font-size: 45px;
  }
  .auth-card {
    padding: 22px;
  }
}

/* Testable web adaptations of iOS navigation, grouped surfaces and motion. */
:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color-scheme: light dark;
  --page: #f2f5fa;
  --surface: #fff;
  --ink: #152743;
  --nav: #e9f0f9;
  --panel: #edf3fb;
  --glass: rgba(250, 253, 255, 0.82);
  background: var(--page);
  color: var(--ink);
}
.side {
  background: var(--nav);
  color: var(--ink);
  border-right: 1px solid var(--line);
}
.side nav a,
.side button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.side nav a[aria-current] {
  background: #dceaff;
  color: #12439b;
}
.side nav a:hover {
  background: #d6e5f8;
}
.side button:hover {
  background: var(--panel);
}
.side .brandmark {
  background: #fff;
}
.card {
  background: var(--surface);
  border-radius: 19px;
}
.hero {
  border-radius: 24px;
  background: #112e57;
}
.card:not(.hero) {
  box-shadow: 0 1px 2px #17376806;
}
.stat strong,
.hero .metric {
  font-variant-numeric: tabular-nums;
}
.secondary,
select,
input {
  background: var(--surface);
  color: var(--ink);
}
.primary,
.secondary,
select {
  min-height: 44px;
}
.question-list pre {
  background: var(--panel);
}
.model-actions a[aria-current],
.pill {
  background: var(--panel);
  color: var(--ink);
}
.selected-switch {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: 13px;
  background: var(--panel);
  align-items: center;
}
.selected-switch a {
  padding: 8px 10px;
  color: var(--muted);
  text-decoration: none;
  text-align: center;
  min-height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  white-space: nowrap;
}
.selected-switch a[aria-current] {
  color: var(--blue);
  background: var(--surface);
  box-shadow: 0 1px 3px #18315817;
}
.nav-icon {
  width: 22px;
  height: 22px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side a,
.selected-switch a,
.primary,
.secondary,
.model-card {
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.24s cubic-bezier(0.2, 0.85, 0.3, 1.2),
    border-color 0.18s ease;
}
.side a:active,
.selected-switch a:active,
.primary:active,
.secondary:active,
.model-card:active {
  transform: scale(0.965);
}
.fade-in {
  animation: appear 0.26s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.question-list details[open] > div {
  animation: appear 0.22s ease-out both;
}
.mobile-brand {
  display: none;
}
.metric-note {
  margin-top: 6px;
}
.empty-retry {
  margin-top: 10px;
}
@media (max-width: 850px) {
  .side {
    left: 12px;
    right: 12px;
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 4px;
    border-radius: 27px;
    border: 1px solid #afc5dd88;
    background: var(--glass);
    backdrop-filter: blur(19px) saturate(1.22);
    -webkit-backdrop-filter: blur(19px) saturate(1.22);
    box-shadow: 0 6px 24px #102e5233;
  }
  .side nav a {
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    border-radius: 22px;
    padding: 5px 2px;
  }
  .side button {
    display: none;
  }
  .nav-icon {
    height: 21px;
    width: 21px;
  }
  .mobile-brand {
    display: block;
    margin-bottom: 14px;
  }
  .mobile-brand img {
    width: 93px;
    height: 27px;
  }
  .workspace {
    padding-bottom: calc(83px + env(safe-area-inset-bottom));
  }
  .selects {
    width: 100%;
  }
  .selects select {
    flex: 1;
    min-width: 120px;
  }
  .hero {
    padding: 19px;
  }
  .header h1 {
    line-height: 1.13;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ecf3ff;
    --page: #101925;
    --surface: #172438;
    --nav: #132134;
    --panel: #22344b;
    --glass: rgba(26, 39, 57, 0.86);
    --muted: #b1c2dc;
    --line: #334860;
    --blue: #96bdff;
    --teal: #6ad8c8;
  }
  .side nav a[aria-current],
  .side nav a:hover {
    background: #294467;
    color: #cce1ff;
  }
  .hero {
    background: #193764;
  }
  .primary {
    color: #12284a;
  }
  .error {
    color: #ffccd2;
    background: #512634;
  }
  .state-bad {
    color: #ffadb7;
  }
  .mobile-brand {
    background: #fff;
    width: max-content;
    padding: 4px 8px;
    border-radius: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .side {
    background: var(--nav);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
.trend-item {
  text-decoration: none;
  color: inherit;
}
.trend-item:hover small:last-child {
  text-decoration: underline;
}
.meter-empty {
  display: grid;
  place-items: center;
  min-height: 92px;
}
.model-actions .secondary {
  display: grid;
  place-items: center;
}
.stack .row a.primary,
.stack .row a.secondary {
  display: inline-grid;
  place-items: center;
}
@media (max-width: 850px) {
  .side nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.trend-plot {
  display: block;
  width: 100%;
  height: 134px;
  margin-top: 8px;
  overflow: visible;
}
.trend-grid {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.trend-line {
  fill: none;
  stroke: #2983d9;
  stroke-width: 2.8;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trend-dot {
  fill: #2983d9;
}
.trend-inactive {
  fill: #8697ad;
}
.trend-bars {
  min-height: auto;
  align-items: stretch;
  margin: 5px 0 9px;
}
.trend-item {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  gap: 2px;
}
.trend-item strong {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.trend-item:hover {
  border-color: var(--blue);
}
#retest-form fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
#retest-form legend {
  padding: 0 4px;
}
#retest-form label {
  line-height: 2;
}

/* GEO monitoring dashboard layout */
.mobile-nav { display: none; }
.score-hero { min-height: 0; align-items: center; }
.score-primary { display: flex; align-items: center; gap: clamp(14px,3vw,27px); }
.score-primary svg { width: clamp(86px,11vw,126px); flex: none; }
.score-primary circle { fill: none; stroke-width: 7px; }
.score-track { stroke: var(--line); }
.score-progress { stroke: #139984; transform: rotate(-90deg); transform-origin: center; }
.score-primary svg text { fill: currentColor; font-size: 26px; font-weight: 750; }
.score-primary svg .score-unit { font-size: 10px; font-weight: 500; }
.score-primary h2 { margin: 9px 0 3px; font-size: clamp(20px,2.35vw,30px); }
.score-context { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.score-context div { display: grid; gap: 2px; align-content: start; }
.score-context strong { font-size: clamp(17px,2vw,23px); font-variant-numeric: tabular-nums; }
.score-detail summary { cursor: pointer; font-weight: 650; }
.score-detail p, .brief p { margin-top: 7px; }
.card.empty { padding: 24px; text-align: left; }
.competition-bars { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,245px),1fr)); gap: 12px; margin: 15px 0; }
.comparison-brand { border: 1px solid var(--line); padding: 12px; border-radius: 10px; }
.bar-row { display: grid; grid-template-columns: auto minmax(35px,1fr) 4.1em auto; gap: 8px; align-items: center; margin-top: 7px; font-size: 13px; }
.data-bar { width: 100%; height: 12px; accent-color: var(--teal); }
.data-bar::-webkit-meter-optimum-value { background: #0e8b83; }
.competition-line { fill: none; stroke: var(--series); stroke-width: 2.5; }
.series-0 { --series: #1377cf; }
.series-1 { --series: #168e82; }
.series-2 { --series: #9c62bf; }
.series-3 { --series: #b87316; }
.series-4 { --series: #ca5067; }
.legend { background: var(--series); display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.tag-list, .filter-row { display: flex; flex-wrap: wrap; gap: 9px 14px; margin-top: 12px; }
.filter-row { align-items: end; }
.filter-row label { display: grid; gap: 4px; font-size: 13px; min-width: 0; }
.filter-row select { max-width: min(340px,70vw); }
.delivery-timeline { display: grid; gap: 9px; border-left: 2px solid var(--line); padding-left: 14px; }
@media (max-width: 850px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: inline; }
  .layout .side nav { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 1px; }
  .layout .side nav a { padding-inline: 1px; }
  .score-hero { display: grid; }
  .score-context { padding-top: 10px; }
}

.preview-bar { display:flex; gap:14px; flex-wrap:wrap; align-items:center; background:#e7effd; color:#183d73; padding:10px 16px; }
.preview-bar a { color:inherit; }
