/* Shared interaction and responsive QA layer for the local concept demo. */
html {
  scroll-behavior: smooth;
}

body.demo-enhanced button,
body.demo-enhanced a,
body.demo-enhanced [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

body.demo-enhanced button:focus-visible,
body.demo-enhanced a:focus-visible,
body.demo-enhanced [role="button"]:focus-visible,
body.demo-enhanced input:focus-visible,
body.demo-enhanced select:focus-visible,
body.demo-enhanced textarea:focus-visible {
  outline: 3px solid #81aaff !important;
  outline-offset: 3px;
}

.demo-global-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  box-sizing: border-box;
  width: 100%;
  height: 80px;
  border-bottom: 1px solid rgba(173, 198, 255, 0.14);
  background: rgba(7, 17, 36, 0.94);
  color: #dce5ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  backdrop-filter: blur(18px);
}

.demo-global-nav {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 380px;
  align-items: center;
  gap: 24px;
  width: min(calc(100% - 48px), 1440px);
  height: 80px;
  margin: 0 auto;
}

.demo-global-brand {
  display: block;
  color: #adc6ff !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 28px !important;
  font-weight: 700 !important;
  line-height: 34px !important;
  letter-spacing: -0.04em !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.demo-global-links {
  display: flex;
  align-items: stretch;
  justify-content: center;
  align-self: stretch;
  gap: clamp(20px, 2vw, 38px);
  min-width: 0;
}

.demo-global-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 !important;
  color: #c3c9d4 !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 20px !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.demo-global-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #adc6ff;
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 160ms ease, transform 160ms ease;
}

.demo-global-links a:hover,
.demo-global-links a[aria-current="page"] {
  color: #adc6ff !important;
}

.demo-global-links a:hover::after,
.demo-global-links a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.demo-global-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.demo-global-search {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  width: 212px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(173, 198, 255, 0.22);
  border-radius: 4px;
  background: rgba(3, 13, 31, 0.72);
}

.demo-global-search input {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  height: 40px;
  padding: 0 0 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e7ecf8;
  font: 500 13px/20px "JetBrains Mono", ui-monospace, monospace;
}

.demo-global-search input::placeholder {
  color: #7f899d;
  opacity: 1;
}

.demo-global-search button {
  box-sizing: border-box;
  width: 42px;
  min-width: 42px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #adc6ff;
  cursor: pointer;
}

.demo-global-search svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.demo-global-quote {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 154px;
  width: 154px !important;
  min-width: 154px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 18px !important;
  border: 1px solid #adc6ff !important;
  border-radius: 4px !important;
  background: #adc6ff !important;
  color: #092657 !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 20px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  cursor: pointer;
}

.demo-global-quote:hover {
  background: #c6d6ff !important;
}

.demo-global-sidebar {
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 0;
  z-index: 40;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 256px;
  height: calc(100vh - 80px);
  padding: 32px 20px 20px;
  overflow-y: auto;
  border-right: 1px solid rgba(173, 198, 255, 0.14);
  background: #111b31;
  color: #dce5ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.demo-sidebar-heading {
  box-sizing: border-box;
  padding: 0 10px 24px;
  border-bottom: 1px solid rgba(173, 198, 255, 0.12);
}

.demo-sidebar-heading h2 {
  margin: 0 0 7px;
  color: #adc6ff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 34px;
  letter-spacing: -0.025em;
}

.demo-sidebar-heading p {
  margin: 0;
  color: #9da7ba;
  font: 500 12px/18px "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-sidebar-links {
  display: grid;
  gap: 6px;
  padding: 20px 0;
}

.demo-sidebar-links a {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  border-left: 3px solid transparent;
  border-radius: 3px;
  color: #c3c9d4 !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 20px !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  text-transform: none !important;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.demo-sidebar-links a .material-symbols-outlined {
  width: 24px;
  overflow: hidden;
  font-size: 21px;
  line-height: 24px;
  text-align: center;
}

.demo-sidebar-links a:hover {
  border-left-color: rgba(173, 198, 255, 0.55);
  background: rgba(173, 198, 255, 0.09);
  color: #dce5ff !important;
}

.demo-sidebar-links a[aria-current="page"] {
  border-left-color: #adc6ff;
  background: #4e8ff7;
  color: #061934 !important;
}

.demo-sidebar-download {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  margin-top: auto;
  padding: 9px 12px;
  border: 1px solid rgba(173, 198, 255, 0.34);
  border-radius: 4px;
  background: transparent;
  color: #adc6ff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 650;
  line-height: 20px;
  cursor: pointer;
}

.demo-sidebar-download:hover {
  border-color: #adc6ff;
  background: rgba(173, 198, 255, 0.1);
}

.demo-sidebar-download .material-symbols-outlined {
  font-size: 19px;
}

.demo-global-header .demo-menu-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(173, 198, 255, 0.28);
  border-radius: 4px;
  background: transparent;
  color: #adc6ff;
}

.demo-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-card-action {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid rgba(173, 198, 255, 0.28);
  border-radius: 4px;
  color: #dce5ff !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 650;
  line-height: 20px;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.demo-card-action-primary:hover {
  border-color: #adc6ff;
  background: #adc6ff;
  color: #092657 !important;
}

.demo-card-action-secondary {
  border-color: rgba(0, 229, 255, 0.48);
  color: #70e8f5 !important;
}

.demo-card-action-secondary:hover {
  border-color: #70e8f5;
  background: rgba(112, 232, 245, 0.12);
}

.demo-top-nav,
.demo-top-header {
  width: 100% !important;
  max-width: none !important;
  min-height: 80px;
  padding-inline: clamp(20px, 4vw, 64px) !important;
}

.demo-top-nav > .demo-nav-inner,
.demo-top-header > .demo-nav-inner {
  width: 100%;
  max-width: 1440px !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}

.demo-top-nav.demo-nav-direct,
.demo-top-header.demo-nav-direct {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: clamp(16px, 2vw, 36px) !important;
}

.demo-nav-brand {
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer;
}

.demo-nav-links {
  display: flex !important;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
  gap: clamp(14px, 1.7vw, 30px) !important;
  min-width: 0;
}

.demo-nav-links a {
  flex: 0 0 auto;
  padding: 8px 0 !important;
  font-size: clamp(13px, 1vw, 16px) !important;
  line-height: 1.25 !important;
  white-space: nowrap;
}

.demo-nav-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 14px !important;
}

.demo-nav-search {
  min-width: 0 !important;
  width: clamp(180px, 17vw, 260px) !important;
}

.demo-cta,
body.demo-enhanced button:not(.demo-icon-button) {
  box-sizing: border-box;
  min-height: 42px;
  height: auto !important;
  line-height: 1.2 !important;
  overflow: visible !important;
  text-align: center;
}

.demo-cta {
  min-width: 146px;
  padding: 11px 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

.demo-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
}

.demo-menu-toggle {
  display: none !important;
}

.demo-mobile-menu {
  position: fixed;
  inset: 80px 16px auto 16px;
  z-index: 120;
  display: none;
  padding: 18px;
  border: 1px solid rgba(173, 198, 255, 0.28);
  border-radius: 12px;
  background: rgba(8, 17, 35, 0.97);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
}

.demo-mobile-menu[data-open="true"] {
  display: grid;
  gap: 8px;
}

.demo-mobile-menu a {
  display: block;
  padding: 13px 14px;
  border-radius: 8px;
  color: #dae2fd;
  text-decoration: none;
}

.demo-mobile-menu a:hover,
.demo-mobile-menu a:focus-visible {
  background: rgba(129, 170, 255, 0.12);
  color: #adc6ff;
}

.demo-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  width: min(420px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid rgba(129, 170, 255, 0.5);
  border-radius: 10px;
  background: #101a31;
  color: #edf0ff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  font: 600 14px/1.45 Inter, system-ui, sans-serif;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.demo-toast[data-show="true"] {
  opacity: 1;
  transform: translateY(0);
}

.demo-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(1, 7, 18, 0.82);
  backdrop-filter: blur(10px);
}

.demo-dialog-backdrop[data-open="true"] {
  display: grid;
}

.demo-dialog {
  width: min(560px, 100%);
  max-height: min(720px, 88vh);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(173, 198, 255, 0.35);
  border-radius: 14px;
  background: #101a31;
  color: #edf0ff;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
}

.demo-dialog h2 {
  margin: 0 0 12px;
  color: #adc6ff;
  font: 700 24px/1.2 Inter, system-ui, sans-serif;
}

.demo-dialog p {
  margin: 0 0 20px;
  color: #c1c7cf;
  font: 400 15px/1.6 Inter, system-ui, sans-serif;
}

.demo-dialog button {
  min-width: 110px;
  padding: 10px 18px;
  border: 0;
  border-radius: 7px;
  background: #adc6ff;
  color: #002e6a;
  font-weight: 700;
  cursor: pointer;
}

.demo-filter-hidden {
  display: none !important;
}

.demo-empty-state {
  display: none;
  padding: 28px;
  border: 1px dashed rgba(173, 198, 255, 0.35);
  border-radius: 10px;
  color: #c1c7cf;
  text-align: center;
}

.demo-empty-state[data-show="true"] {
  display: block;
}

.demo-upload-selected {
  border-color: #81aaff !important;
  background: rgba(129, 170, 255, 0.08) !important;
}

.demo-3d-instruction {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 15;
  max-width: calc(100% - 28px);
  padding: 8px 11px;
  border: 1px solid rgba(173, 198, 255, 0.3);
  border-radius: 7px;
  background: rgba(6, 14, 32, 0.78);
  color: #dae2fd;
  font: 600 11px/1.35 "JetBrains Mono", monospace;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

[data-demo-clickable="true"] {
  cursor: pointer;
}

@media (min-width: 768px) {
  body.demo-enhanced > footer.demo-offset-footer {
    width: calc(100% - 16rem) !important;
    max-width: calc(100% - 16rem) !important;
  }
}

@media (max-width: 1320px) {
  .demo-global-nav {
    grid-template-columns: 180px minmax(0, 1fr) 168px;
  }

  .demo-global-search {
    display: none;
  }

  .demo-nav-search {
    display: none !important;
  }
}

@media (max-width: 1120px) {
  .demo-global-nav {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
  }

  .demo-global-links {
    display: none;
  }

  .demo-nav-links {
    display: none !important;
  }

  .demo-menu-toggle {
    display: inline-flex !important;
  }

  .demo-top-nav,
  .demo-top-header {
    padding-inline: 20px !important;
  }
}

@media (max-width: 640px) {
  .demo-global-header,
  .demo-global-nav {
    height: 72px;
  }

  .demo-global-nav {
    width: calc(100% - 32px);
  }

  .demo-global-brand {
    font-size: 22px !important;
    line-height: 28px !important;
  }

  .demo-global-quote {
    display: none !important;
  }

  .demo-top-nav,
  .demo-top-header {
    min-height: 72px;
    padding-inline: 16px !important;
  }

  .demo-nav-brand {
    font-size: 20px !important;
  }

  .demo-cta {
    display: none !important;
  }

  .demo-mobile-menu {
    inset: 72px 12px auto 12px;
  }

  .demo-toast {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 767px) {
  .demo-global-sidebar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .demo-toast,
  body.demo-enhanced * {
    transition-duration: 0.01ms !important;
  }
}
