/*
 * Phase 7A production-parity layer.
 *
 * The byte-preserved main.css remains the visual baseline. This stylesheet
 * self-hosts the two historical interface families and adds focus treatment
 * without changing the established desktop geometry, palette, or controls.
 */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/open-sans-v44-greek-wght-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C,
    U+038E-03A1, U+03A3-03FF;
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/open-sans-v44-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Droid Sans Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/droid-sans-mono-v21-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --cf-focus: #0459b7;
  --cf-ui-font: "Open Sans", sans-serif;
  --cf-mono-font: "Droid Sans Mono", monospace;
}

html,
body {
  min-width: 1180px;
  color: #000000;
  background: #cccccc;
  font-family: var(--cf-ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#header h1 {
  color: #000000;
  font-family: var(--cf-ui-font);
  font-size: 32px;
  font-weight: 700;
  line-height: normal;
  letter-spacing: normal;
}

#datatable,
.datatable,
input[type="text"],
input[type="password"],
#prevmessage > div {
  font-family: var(--cf-mono-font);
}

.resetbutton,
.csvbutton,
.sesbutton,
.addrembutton,
select {
  font-family: var(--cf-ui-font);
}

.resetbutton:focus-visible,
.csvbutton:focus-visible,
.sesbutton:focus-visible,
.addrembutton:focus-visible,
.toggle-btn:focus-within {
  outline: 3px solid rgba(4, 89, 183, 0.28);
  outline-offset: 1px;
}

select:focus-visible,
input[type="text"]:focus-visible,
input[type="password"]:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="submit"]:focus-visible {
  outline: 3px solid rgba(4, 89, 183, 0.28);
  outline-offset: 1px;
}

#curvefit-workspace,
.cf-loading-host {
  position: relative;
}

.cf-boot-content {
  opacity: 1;
  transition: opacity 0.15s ease;
}

html.cf-booting .cf-boot-content,
html.cf-load-failed .cf-boot-content {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

#curvefit-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

#curvefit-loading-error {
  display: none;
  position: absolute;
  top: 150px;
  left: 210px;
  width: 696px;
  padding: 34px 30px;
  border: 3px solid #444;
  background: #fff;
  text-align: center;
  pointer-events: auto;
}

#curvefit-loading-error h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

#curvefit-loading-error p {
  margin: 0 auto 18px;
  max-width: 570px;
  line-height: 1.5;
}

html.cf-load-failed #curvefit-loading-error {
  display: block;
}

.cf-panel-skeleton {
  position: absolute;
  z-index: 3;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

html.cf-booting .cf-panel-skeleton {
  visibility: visible;
  opacity: 1;
}

html.cf-load-failed .cf-panel-skeleton {
  visibility: visible;
  opacity: 0.46;
}

.cf-panel-skeleton::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -54%;
  z-index: 5;
  width: 48%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  animation: cf-skeleton-shimmer 1.35s ease-in-out infinite;
}

html.cf-load-failed .cf-panel-skeleton::after {
  animation: none;
}

.cf-data-skeleton {
  top: 4px;
  left: 4px;
  width: 430px;
  height: 605px;
  border: 2px solid #cbcbcb;
  background: #dedede;
}

.cf-plot-skeleton {
  inset: 0 auto auto 0;
  width: 724px;
  height: 275px;
  background: #dedede;
}

.cf-controls-skeleton {
  top: 6px;
  left: 6px;
  width: 716px;
  height: 300px;
  background:
    repeating-linear-gradient(
      to bottom,
      #0000 0,
      #0000 15px,
      #dedede 15px,
      #dedede 35px,
      #0000 35px,
      #0000 46px
    ) 56px 25px / 235px 225px no-repeat,
    repeating-linear-gradient(
      to bottom,
      #0000 0,
      #0000 15px,
      #dedede 15px,
      #dedede 35px,
      #0000 35px,
      #0000 46px
    ) 385px 25px / 285px 225px no-repeat,
    linear-gradient(to right, #f0f0f0 47.7%, #ddd 47.7%, #ddd 48.1%, #f0f0f0 48.1%);
}

.cf-footer-skeleton {
  inset: 5px 10px auto;
  height: 24px;
  background:
    linear-gradient(#dedede 0 0) left center / 82px 19px no-repeat,
    linear-gradient(#dedede 0 0) right center / 210px 19px no-repeat,
    #ccc;
}

@keyframes cf-skeleton-shimmer {
  to {
    transform: translateX(330%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .cf-panel-skeleton::after {
    animation: none !important;
  }
}
