/* ONE-Z shared UI foundations. Extracted from the approved r5 homepage.
   View composition belongs in styles.css; this file also runs without legacy.css. */
:root {
  color-scheme: light;
  --ink: #17213e;
  --muted: #59667c;
  --quiet: #65728a;
  --line: #dce2ef;
  --paper: #f8f9fd;
  --panel: #ffffff;
  --wash: #eef1f9;
  --deep: #4059cc;
  --deep-2: #334ab4;
  --teal: var(--deep);
  --teal-soft: #edf0ff;
  --blue-soft: #edf2ff;
  --amber-soft: #f1effc;
  --ink-soft: #42516d;
  --aux-heading: #58658a;
  --aux-label: #626d8b;
  --aux-body: #66718a;
  --surface-hover: #edf1ff;
  --line-hover: #a6b6e8;
  --font-ui: "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --text-caption: 12px;
  --text-small: 13px;
  --text-body: 14px;
  --text-control: 16px;
  --text-section: 24px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --radius-control: 12px;
  --radius-card: 20px;
  --radius-panel: 28px;
  --radius-pill: 999px;
  --shadow: 0 12px 32px rgb(67 83 145 / 8%);
  --shadow-card: 0 4px 12px rgb(64 82 136 / 3%);
  --shadow-raised: 0 16px 44px rgb(65 85 150 / 7%);
  --shadow-hover: 0 10px 26px rgb(64 82 136 / 9%);
  --hero-background:
    radial-gradient(ellipse at 95% 12%, rgb(209 222 255 / 68%), transparent 52%),
    radial-gradient(ellipse at 85% 84%, rgb(226 218 255 / 58%), transparent 48%),
    linear-gradient(120deg, #f3f8ff 0%, #edf3ff 65%, #f0edff 100%);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
a { color: var(--deep); }
:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--deep);
  outline-offset: 4px;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 50;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 max(32px, calc((100% - 1280px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 23px;
  line-height: 32px;
  font-weight: 750;
  letter-spacing: -1px;
  cursor: pointer;
}
.brand-main { color: var(--ink); transition: color 180ms ease; }
.brand-sep { padding: 0 8px; }
.brand-sub, .brand-sep { color: #647098; font-weight: 650; }
/* The original wordmark treatment is intentionally limited to ONE-Z. */
.brand:hover .brand-main, .brand:focus-visible .brand-main {
  color: transparent;
  background: linear-gradient(90deg, #008a71, #0f7bdc, #8d4dff, #ff5b5f, #ff9d2e, #008a71);
  background-size: 240% 100%;
  background-repeat: repeat-x;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Original speed: (2.4 - 1) * 2.4 / 1.6 = 2.1 wordmark widths/s.
     One 2.4-width tile takes 8/7 seconds; 12/7 position units move that tile. */
  animation: brandRainbow 1.1428571429s linear infinite;
}
@keyframes brandRainbow {
  from { background-position: 0% 50%; }
  to { background-position: 171.428571429% 50%; }
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-tab {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.nav-tab:hover { color: var(--ink); background: var(--wash); }
.nav-tab.active {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 3px 10px rgb(66 83 146 / 5%);
}
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 1px solid #c7d0ed;
  border-radius: var(--radius-control);
  background: var(--panel);
  padding: 12px 24px;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.btn:hover { box-shadow: none; background: #f5f6ff; }
.btn.primary { background: var(--deep); border-color: var(--deep); color: white; }
.btn.primary:hover { background: var(--deep-2); border-color: var(--deep-2); }
.btn:active, .shortcut:active { transform: translateY(1px); }
.btn:disabled { background: #eef0f6; color: #65728a; border-color: var(--line); cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.entry-term {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #d8dfef;
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 20px;
  font-weight: 400;
  cursor: pointer;
}
.entry-term:hover { background: var(--surface-hover); border-color: var(--line-hover); }
.filter-row .entry-term.active, .entry-term[aria-pressed="true"] {
  background: var(--deep);
  border-color: var(--deep);
  color: var(--panel);
}
.badge, .mini, .ui-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  background: var(--teal-soft);
  color: #4257b3;
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
}
.badge.neutral, .mini { background: #f1f3fa; color: var(--muted); }
.badge-button { border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.badge-button:hover { background: #dfe5ff; }
.badge-button.active { background: var(--deep); color: var(--panel); }
.mini.grade { background: #f1f3fc; color: var(--muted); }
.mini.grade::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: #566ccf;
  box-shadow: 0 0 0 3px rgb(86 108 207 / 8%);
}
.mini.grade-b::before { background: #7a88a6; box-shadow: 0 0 0 3px rgb(122 136 166 / 8%); }
.source {
  min-height: 40px;
  height: auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--deep-2);
  font-size: 13px;
  line-height: 22px;
  font-weight: 600;
  cursor: pointer;
}
.source:hover { background: var(--surface-hover); border-color: var(--line-hover); }
.ui-forward-arrow {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
}
.shortcut-arrow .ui-forward-arrow { display: block; width: 14px; height: 14px; line-height: 14px; }
.ui-chevron {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.shortcut-arrow > .ui-chevron { display: block; }
.inline-link { display: inline-flex; align-items: center; gap: 6px; color: var(--deep); text-decoration: none; white-space: nowrap; font-weight: 600; }
.inline-link span { margin-left: 6px; }
.inline-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.ui-panel, .ui-card, .ui-empty, .industry-summary, .aside-card, .opportunity, .source-section {
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}
.ui-panel { border-radius: var(--radius-panel); box-shadow: var(--shadow); }
.ui-stat { padding: 16px; border-radius: var(--radius-control); background: #f1f3fa; }
.ui-stat strong { display: block; color: #25345b; font-size: 28px; line-height: 36px; font-weight: 600; }
.ui-stat span { color: var(--muted); font-size: 12px; line-height: 20px; }
.ui-title { margin: 0 0 12px; color: var(--ink); font-size: 24px; line-height: 36px; font-weight: 600; }
.ui-copy { margin: 0; color: var(--muted); font-size: 14px; line-height: 26px; }
.ui-caption { color: var(--quiet); font-size: 12px; line-height: 22px; }
.ui-empty p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 26px; }
.ui-status { padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--blue-soft); color: #4257b3; font-size: 14px; line-height: 26px; }
.ui-status strong { display: block; font-weight: 600; }
.ui-status.warning { border-color: #e1d8f0; background: #f5f0fc; color: #685582; }
.modal-backdrop { background: rgb(30 42 83 / 30%); padding: 20px; }
.modal { max-height: calc(100dvh - 40px); overflow: auto; border-radius: var(--radius-card); box-shadow: 0 24px 80px rgb(41 58 122 / 20%); }
.modal-item { border-color: var(--line); background: #f7f9ff; }
.toast { box-shadow: 0 12px 36px rgb(41 58 122 / 20%); }
@media (max-width: 720px) {
  html { scroll-padding-top: 80px; }
  .nav { height: 64px; padding: 0 16px; }
  .brand { font-size: 19px; line-height: 28px; letter-spacing: -1px; }
  .brand-sep { padding: 0 6px; }
  .nav-actions { gap: 4px; }
  .nav-tab { padding: 8px 12px; font-size: 13px; }
  .btn { width: 100%; min-height: 48px; padding: 12px 16px; font-size: 15px; }
}
@media (max-width: 360px) {
  .nav { padding: 0 12px; }
  .brand { font-size: 17px; }
  .nav-tab { padding: 8px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:active, .shortcut:active { transform: none; }
  .brand:hover .brand-main, .brand:focus-visible .brand-main { animation: none; background-position: 100% 50%; }
}
