/* MicroMind premium quality overlay. Visual/IA only. No new product colors. */
:root {
  --mmq-space-4: 4px;
  --mmq-space-8: 8px;
  --mmq-space-12: 12px;
  --mmq-space-16: 16px;
  --mmq-space-20: 20px;
  --mmq-space-24: 24px;
  --mmq-space-32: 32px;
  --mmq-space-40: 40px;
  --mmq-space-48: 48px;
  --mmq-space-64: 64px;
  --mmq-ink: #12233d;
  --mmq-muted: #5b6b80;
  --mmq-line: #d7e3ef;
  --mmq-paper: #ffffff;
  --mmq-soft: #f4f8fc;
  --mmq-sky: #1769d1;
  --mmq-green: #0d6b4d;
  --mmq-gold: #b88936;
  --mmq-radius: 16px;
  --mmq-radius-sm: 12px;
  --mmq-header-h: 72px;
  --mmq-shadow: 0 8px 24px #14305514;
  --mmq-focus: #1769d1;
  --mm-bottom-status-height: 48px;
  --mm-bottom-status-gap: 16px;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .top-tab:hover,
  .r4-top-link:hover,
  .app-sidebar nav a:hover,
  .app-global-nav a:hover,
  .category-row a:hover,
  .mm-profile-nav a:hover,
  .mm-profile-nav button:hover,
  .r4-side-link:hover,
  .mini-tab:hover {
    transform: none !important;
    filter: none !important;
  }
}

body {
  color: var(--mmq-ink);
}

.sr-only,
.mmq-skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mmq-skip:focus {
  position: fixed;
  left: var(--mmq-space-16);
  top: var(--mmq-space-16);
  z-index: 10000;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: var(--mmq-space-12) var(--mmq-space-16);
  border-radius: var(--mmq-radius-sm);
  background: var(--mmq-paper);
  color: var(--mmq-ink);
  box-shadow: var(--mmq-shadow);
}

/* Shared header rhythm */
.topbar,
.app-header,
.r4-site-header {
  min-height: var(--mmq-header-h);
  align-items: center;
}

.brand-original-logo,
.brand-mark img,
.r4-logo-medal {
  max-height: 40px;
  width: auto;
}

/* Tabs: readable, high-contrast active, scroll on small screens */
.top-tabs,
.category-row,
.r4-top-nav,
.app-sidebar nav,
.app-global-nav {
  display: flex;
  gap: var(--mmq-space-8);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.top-tabs,
.category-row,
.r4-top-nav,
.app-sidebar nav,
.app-global-nav,
.mm-profile-nav {
  padding-top: var(--mmq-space-8);
  padding-bottom: var(--mmq-space-8);
}

.top-tab,
.r4-top-link,
.app-sidebar nav a,
.app-global-nav a,
.category-row a,
.mm-profile-nav a,
.mm-profile-nav button,
.r4-side-link,
.mini-tab {
  min-height: 44px;
  padding: var(--mmq-space-8) var(--mmq-space-16);
  border-radius: 999px;
  color: var(--mmq-ink);
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transform-origin: center center;
  will-change: transform;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    filter 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .top-tab:hover,
  .r4-top-link:hover:not(:disabled),
  .app-sidebar nav a:hover,
  .app-global-nav a:hover,
  .category-row a:hover,
  .mm-profile-nav a:hover,
  .mm-profile-nav button:hover,
  .r4-side-link:hover:not(:disabled),
  .mini-tab:hover {
    transform: translateY(-2px) scale(1.3);
    filter: brightness(1.06);
    z-index: 3;
    position: relative;
    background: var(--mmq-soft);
  }
}

.top-tab:hover,
.r4-top-link:hover:not(:disabled),
.app-sidebar nav a:hover,
.app-global-nav a:hover,
.r4-side-link:hover:not(:disabled) {
  background: var(--mmq-soft);
}

.r4-top-link:disabled:hover,
.r4-side-link:disabled:hover,
.side-link.is-disabled:hover {
  transform: none;
  filter: none;
  cursor: not-allowed;
}

.top-tab:focus-visible,
.r4-top-link:focus-visible,
.app-sidebar nav a:focus-visible,
.app-global-nav a:focus-visible,
.category-row a:focus-visible,
.btn:focus-visible,
.cta:focus-visible,
.side-link:focus-visible,
.r4-side-link:focus-visible,
.mmki-launcher:focus-visible {
  outline: 3px solid var(--mmq-focus);
  outline-offset: 2px;
}

.top-tab.active,
.r4-top-link.active,
.app-sidebar nav a.active,
.app-global-nav a[aria-current="page"] {
  color: #072033;
  background: #e8f2ff;
  box-shadow: inset 0 -3px 0 var(--mmq-sky);
  font-weight: 800;
}

.side-link.is-disabled,
.r4-top-link:disabled,
.r4-side-link:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  text-decoration: none;
}

/* Buttons */
.btn,
.cta,
.r4-header-action,
.r4-cat-button,
.card-action {
  min-height: 44px;
  border-radius: 999px;
  padding: var(--mmq-space-8) var(--mmq-space-20);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mmq-space-8);
}

.btn-primary,
.cta-green,
.r4-cat-button {
  background: var(--mmq-sky);
  color: #fff;
  border: 1px solid var(--mmq-sky);
}

.btn-ghost,
.cta-gold {
  border: 1px solid var(--mmq-line);
}

/* Cards / panels */
.dashboard-card,
.panel,
.profile-card,
.r4-service-card,
.match-item,
.ai-status-card,
.flow-steps article {
  border: 1px solid var(--mmq-line);
  border-radius: var(--mmq-radius);
  box-shadow: var(--mmq-shadow);
  background: var(--mmq-paper);
}

.flow-steps,
.metric-grid,
.ops-grid,
.dashboard-grid,
.profile-grid,
.r4-services {
  gap: var(--mmq-space-16);
}

/* Typography */
h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.25; }
h3 { font-size: 1.05rem; line-height: 1.35; }
p, li, label, dd { line-height: 1.55; }
small, .eyebrow { font-size: 0.8125rem; letter-spacing: 0.04em; color: var(--mmq-muted); }

/* Forms */
input, textarea, select {
  min-height: 44px;
  border-radius: var(--mmq-radius-sm);
  border: 1px solid var(--mmq-line);
  padding: var(--mmq-space-8) var(--mmq-space-12);
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid #d8ebff;
  border-color: var(--mmq-sky);
}
label, .job-contact-field > span, .profile-field > span {
  display: block;
  margin-bottom: var(--mmq-space-8);
  font-weight: 650;
}

/* Homepage IA: keep hero first, categories next, KI reachable */
.hero-copy { margin-bottom: var(--mmq-space-32); }
.public-flow-section,
.public-categories-section { margin-top: var(--mmq-space-32); }
.ai-panel { margin-top: var(--mmq-space-40); }
.trust-bar {
  min-height: var(--mm-bottom-status-height);
  gap: var(--mmq-space-12);
  padding: var(--mmq-space-12) var(--mmq-space-16);
  padding-bottom: calc(var(--mmq-space-12) + env(safe-area-inset-bottom));
}

/* Category page alignment */
.r4-cat-hero,
.r4-cat-copy { gap: var(--mmq-space-16); }
.r4-cat-back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-bottom: var(--mmq-space-16);
}

/* Customer / company shell */
.app-content,
.company-wrap,
.profile-wrap,
.section .container {
  max-width: 1180px;
}

.app-header-actions,
.top-actions {
  display: flex;
  align-items: center;
  gap: var(--mmq-space-8);
}

/* KI launcher stays above trust/status bars and remains tappable */
.mmki-launcher {
  z-index: 9200 !important;
  bottom: calc(var(--mm-bottom-status-height) + var(--mm-bottom-status-gap) + env(safe-area-inset-bottom)) !important;
}
.mmki-panel {
  z-index: 9190 !important;
}

/* Mobile */
@media (max-width: 768px) {
  .topbar { padding: var(--mmq-space-8) var(--mmq-space-12); }
  .top-tabs,
  .top-actions { max-width: 100%; }
  .main-content,
  .r4-cat-main,
  .app-content,
  .company-wrap,
  .profile-wrap { padding-left: var(--mmq-space-16); padding-right: var(--mmq-space-16); }
  .ai-actions { display: grid; gap: var(--mmq-space-8); }
  .ai-actions button { min-height: 44px; justify-content: space-between; }
}

@media (max-width: 430px) {
  h1 { font-size: 1.6rem; }
  .cta span[data-i18n] { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
}

@media (min-width: 1280px) {
  .viewport-shell,
  .r4-category-app { max-width: 1440px; margin-inline: auto; }
}
