/* Shared release baseline. See docs/home-visual-interaction-standard.md. */
:root {
  --color-text-muted: #60685f;
  --color-text-secondary: #525c55;
  --site-focus: #6c63e6;
}

html { scroll-padding-top: 100px; }
body { overflow-wrap: break-word; }
img { max-width: 100%; }
/* Official square artwork must not stretch or shrink inside flex layouts. */
img[src*="assets/brand/aijia-logo-client-"] {
  display: block;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--site-focus);
  outline-offset: 4px;
}
a[href^="mailto:"] { overflow-wrap: anywhere; }
summary { min-height: 44px; align-content: center; }
button { touch-action: manipulation; }
.topbar-links { flex-wrap: wrap; }
.topbar-links a, .footer-links a { min-height: 24px; display: inline-flex; align-items: center; }
.site-registration {
  padding: 20px 16px;
  text-align: center;
  background: var(--color-bg-base, #f7f8f6);
  color: #525f55;
  font-size: 12px;
  line-height: 2;
}
.site-registration a { display: inline-block; min-height: 24px; }
.site-registration a:hover { text-decoration: underline; }
.search-status { font-size: 14px; color: #525f55; margin-top: 16px; line-height: 1.8; }
.help-guide { border-top: 1px solid var(--color-border, #dce2dc); padding: 24px 0; }
.help-guide h3 { font-size: 18px; margin-bottom: 12px; }
.help-guide p { font-size: 14px; line-height: 1.9; color: #525c55; }
.help-guide a { display: inline-block; padding: 8px 0; font-size: 13px; margin-top: 8px; }
.copy-ok { height: auto; }
.load-status { text-align: center; padding: 36px 16px; color: #525c55; line-height: 1.9; }
.load-status button { min-height: 44px; margin-top: 16px; padding: 10px 20px; border: 1px solid #626b65; border-radius: 6px; background: white; color: #263b31; cursor: pointer; }

/* Homepage: small text must remain readable on every surface. */
:root { --muted: #59675e; }
.console-top, .console-heading > span:last-child, .console-table th { color: #61705b; }
.console-top, .console-summary div, .console-table, .console-note { font-size: 12px; }
.console-heading > span:last-child { font-size: 11px; }
.console-summary div { color: #5e6e56; }
.console-note { color: #72603a; }
.status { color: #405d32; font-size: 11px; }
.team-tabs button { color: #51634d; min-height: 44px; }
.workflow-bar, .workflow-hint, .workflow-steps { color: #596a50; font-size: 12px; }
.workflow-bar small { color: #596a50; font-size: 11px; }
.file-type { color: #536a43; }
.deliverable span { color: #586b49; font-size: 11px; }
.output-label { color: #726448; font-size: 12px; }
.output-card div { font-size: 12px; }
.hero-assurance, .caption, .legal { font-size: 12px; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; }
.language-toggle { min-height: 44px; min-width: 44px; }
.menu-toggle { width: 44px; height: 44px; }
.btn { min-height: 44px; }
.btn:active { transform: translateY(0); }
.btn.secondary:hover { border-color: #6b776d; background: #e6ebe3; }
.team-tabs button:hover { background: #e2e9de; }
.team-tabs button[aria-selected="true"] { background: #fff; }
#team-panel { outline-offset: 6px; }
.legal a { display: inline-block; min-height: 24px; }
.nav-links.open { max-height: calc(100dvh - 72px); overflow-y: auto; }
.nav-links.open a { width: 100%; }

/* Haihai retains its own campaign palette. */
.site-haihai .hero-stats .label, .site-haihai .identity .section-subtitle,
.site-haihai .identity-step p, .site-haihai .cta-section p { color: #c3b8a6; }
.site-haihai .scroll-hint, .site-haihai .identity-step .step-num { color: #b2a58e; }
.site-haihai footer { color: #b9ae9d; }
.site-haihai .site-registration { color: #d4c8b4; background: #1a1510; }
.site-haihai .narrative-quote .highlight-amber { color: #86631d; }

/* Historical public presentations keep their visual identity; navigation must reflow. */
.archive-home { display: block; padding: 24px; text-align: center; font-size: 14px; color: #c4b5fd; background: #0a0e1a; }
.site-archive nav { flex-wrap: wrap; gap: 8px; }
.site-archive nav > div { min-width: 0; }
.site-archive nav > div:last-child { display: flex; flex-wrap: wrap; gap: 4px; }
.site-archive nav a { margin: 0; padding: 8px 10px; min-height: 36px; }
.site-archive .grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.site-archive .grid-4, .site-archive .team-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.site-archive table { display: block; overflow-x: auto; }

@media (max-width: 800px) {
  .nav { gap: 8px; }
  .nav-actions { gap: 4px; }
  .nav-actions .btn { padding: 10px; }
  .console-top, .console-table { font-size: 11px; }
  .console-summary div { font-size: 11px; }
  .status { font-size: 10px; padding: 4px; }
  .console-note { font-size: 11px; }
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .topbar-links { gap: 12px; }
  .topbar-links a { padding: 8px 0; }
  .site-archive nav { position: sticky; padding: 12px 16px; }
  .site-archive nav a { font-size: 12px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Contrast repairs verified against computed foreground/background pairs. */
.journey b { color: #687a62; }
.site-help .section a, .site-registration a { color: #6d5928; }
.site-onboarding .side-menu a.active { color: #6d5928; background: #edece2; }
.site-onboarding .flow-step-num, .site-onboarding .step-badge { background: #725b20 !important; color: #fff; }
.site-onboarding .article a:not(.btn), .site-onboarding .step-section a:not(.btn), .site-onboarding #preview-code { color: #6d5928; }
.site-haihai .site-registration a { color: #d4c8b4; }

button { min-height: 44px; }
.back-link { min-height: 24px; display: inline-flex; align-items: center; }
.copy-ok { color: #306a44; }
.copy-ok.error { color: #923a2d; }

/* Supporting articles and historical presentations retain their identities. */
.site-help .foot a, .site-onboarding .foot a { color: #6d5928; }
.site-help a[href^="mailto:"], .site-onboarding a[href^="mailto:"] { color: #6d5928; }
.site-haihai .compare-detail { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.site-haihai .about-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.site-haihai .about-text, .site-haihai .about-photo { min-width: 0; }
.site-haihai .about-stat { padding: 16px 8px; min-width: 0; }
.site-haihai .about-stat .num { color: #86631d; font-size: 24px; }
.site-haihai .about-stat .label { color: #76644c; }
.site-haihai .about-text h2 span { color: #86631d !important; }
.site-haihai .narrative-desc, .site-haihai .scenario-card p, .site-haihai .section-subtitle { color: #76644c; }
.site-haihai .narrative-quote span[style], .site-haihai .narrative-desc + div[style] { color: #686354 !important; }
.site-haihai .section-tag, .site-haihai .d-badge.win { color: #77590d; }
.site-haihai .d-feel { color: #77590d; }
.site-haihai .d-badge.other { color: #5c646f; }
.site-haihai .d-tag.green { color: #08724c; }
.site-haihai .d-tag.red, .site-haihai .d-prereq { color: #b82020; }
.site-haihai .identity .section-subtitle { color: #c3b8a6; }
.site-archive:not(.archive-light) .section-tag, .site-archive:not(.archive-light) .tcard .r { color: #a5a7ff; }
.site-archive:not(.archive-light) .old-tag, .site-archive:not(.archive-light) .f-text[style] { color: #a1aec1 !important; }
.site-archive:not(.archive-light) footer, .site-archive:not(.archive-light) .hero .tag { color: #94a3b8; }
.archive-light { --text-muted: #60636a; --primary: #0066cf; --accent: #08764c; overflow-x: visible; }
.archive-light[data-theme="dark"] { --text-muted: #a6a8b1; --accent: #5fce80; --primary: #2997ff; }
.archive-light .equity-segment.shareholder { background: #b9d3c2; color: #142b27; }
.archive-light .legend-item[style*="#F59E0B"] { color: #805a10 !important; }
.archive-light[data-theme="dark"] .legend-item[style*="#F59E0B"] { color: #f5c55b !important; }
@media (max-width: 800px) {
  .site-haihai .about-inner { grid-template-columns: minmax(0, 1fr); }
  .site-haihai .about-stats { gap: 8px; }
  .site-haihai .about-stat .num { font-size: 20px; }
  .site-archive [style*="minmax(400px"] { grid-template-columns: minmax(0, 1fr) !important; }
  .archive-light .no-wrap { white-space: normal; }
  .archive-light .tagline-container, .archive-light .model-container > div { min-width: 0; max-width: 100%; }
  .archive-light .model-container, .archive-light .fund-container { grid-template-columns: minmax(0, 1fr); }
}

.site-haihai .narrative div[style*="color:#9ca3af"], .site-haihai div[style*="color:#9ca3af"] { color: #686354 !important; }
.site-haihai .entre-item p { color: #76644c; }

.site-changelog .product-tag.tenant { color: #62508a; }

/* Visual review: preserve breathing room and read each step without sideways scrolling. */
.topbar-links .topbar-cta { padding: 10px 16px; min-height: 44px; }
@media (max-width: 800px) {
  .site-onboarding .flow-steps { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
  .site-onboarding .flow-step { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 16px; text-align: left; align-items: center; }
  .site-onboarding .flow-step-num { grid-row: span 2; margin-bottom: 0; }
  .site-onboarding .flow-step:not(:last-child)::after { left: 25px; right: auto; top: calc(100% - 6px); width: 2px; height: 12px; }
  .site-haihai .hero-content { padding: 40px 20px; max-width: 100%; }
  .site-haihai .hero h1 { font-size: clamp(34px, 10vw, 44px); line-height: 1.2; letter-spacing: -1px; }
}
@media (max-width: 480px) {
  .archive-light .fin-info { flex-direction: column; max-width: 300px; gap: 12px; }
  .archive-light .fin-card { padding: 20px; }
  .archive-light .fin-card .fin-value { font-size: 30px; white-space: nowrap; }
}
