:root {
  --bg-primary: #000412;
  --bg-secondary: #061224;
  --panel: rgba(4, 15, 29, 0.94);
  --panel-deep: rgba(1, 10, 22, 0.9);
  --control: #051421;
  --cyan: #00d5ff;
  --teal: #19cdbb;
  --green: #12cf80;
  --green-soft: #92e6b9;
  --yellow: #f5deb3;
  --white: #edfafa;
  --muted: #75999f;
  --border: #1d3b3c;
  --border-bright: rgba(55, 218, 207, 0.42);
  --error: #ff737c;
  --success: #4ae1a1;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --transition: 0.24s ease;
  --dur-float: 3.2s;
  --dur-breathe: 3.2s;
  --dur-wave: 0.9s;
  --dur-raise: 0.45s;
  --dur-lower: 0.3s;
  --dur-blink: 4.6s;
  --dur-fall: 0.75s;
  --dur-stand: 0.85s;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(16, 81, 88, 0.12), transparent 32%),
    linear-gradient(120deg, var(--bg-primary), var(--bg-secondary));
  background-attachment: fixed;
  color: var(--white);
  font-family: "Oswald", sans-serif;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: aliceblue;
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--green);
}

.header {
  min-height: 66px;
  padding: 10px clamp(18px, 4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(0, 5, 16, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
}

.logo h1 {
  margin: 0;
  color: var(--teal);
  font-family: "Libertinus Serif", serif;
  font-size: 25px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #159f75;
  background: rgba(5, 24, 31, 0.9);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.logo-icon i,
.footer-brand i {
  transform: rotateY(180deg);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav a {
  color: #d7eeee;
}

.nav-btn,
.primary-btn {
  min-height: 42px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(180deg, #07575b, #064244);
  border: 1px solid rgba(58, 154, 155, 0.5);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    transform var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.nav-btn:hover,
.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #086c70, #075054);
  border-color: rgba(55, 218, 207, 0.72);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.nav-btn:active,
.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.page-shell {
  width: min(1180px, calc(100% - 30px));
  margin: 28px auto 42px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-section {
  min-height: 355px;
  padding: 22px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  background: linear-gradient(135deg, rgba(5, 18, 32, 0.98), rgba(3, 13, 26, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.27);
}

.hero-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.section-label {
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 1.7px;
}

.hero-content h2 {
  max-width: 600px;
  margin: 10px 0 14px;
  color: #eaffff;
  font-family: "Libertinus Serif", serif;
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1.08;
}

.hero-content p {
  max-width: 680px;
  margin: 0;
  color: var(--green);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.72;
}

.hero-tech {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tech span {
  padding: 6px 11px;
  color: #9ce6d0;
  background: rgba(8, 45, 48, 0.55);
  border: 1px solid rgba(45, 127, 123, 0.45);
  border-radius: 999px;
  font-size: 12px;
}

.robot-box {
  min-height: 310px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at center, rgba(21, 73, 86, 0.19), transparent 58%),
    rgba(1, 9, 21, 0.58);
  border: 1px solid rgba(38, 112, 114, 0.78);
  border-radius: 16px;
  overflow: hidden;
}

.robot-box::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(55, 218, 207, 0.06);
  border-radius: 50%;
  box-shadow:
    0 0 0 40px rgba(55, 218, 207, 0.018),
    0 0 0 80px rgba(55, 218, 207, 0.01);
}

.stage {
  width: 100%;
  display: grid;
  justify-items: center;
  position: relative;
  z-index: 2;
}

.robot-stage {
  width: min(100%, 310px);
  aspect-ratio: 720 / 700;
  padding: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.robot-stage svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.robot-stage:focus-visible {
  outline: 2px solid #37dacf;
  outline-offset: 5px;
  border-radius: 18px;
}

.robot-hint {
  margin: -12px 0 12px;
  color: #75979d;
  font-size: 12px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.robot-hint i {
  margin-right: 5px;
}

.robot-hint.is-hidden {
  opacity: 0;
  transform: translateY(4px);
}

#robotFloat,
#robot,
#body,
#head,
#leftArm,
#rightArm,
#leftEye,
#rightEye,
#mouth,
#shadow {
  transform-box: view-box;
  will-change: transform;
}

#robotFloat {
  animation: float var(--dur-float) ease-in-out infinite;
}

#shadow {
  animation: shadowBreathe var(--dur-float) ease-in-out infinite;
}

#body {
  animation: breathe var(--dur-breathe) ease-in-out infinite;
}

#head {
  animation: headBob var(--dur-breathe) ease-in-out infinite;
}

#leftEye,
#rightEye {
  animation: blink var(--dur-blink) infinite;
}

#rightArm {
  transform: rotate(0);
}

.is-waving #rightArm {
  animation:
    armRaise var(--dur-raise) cubic-bezier(0.34, 1.3, 0.64, 1) forwards,
    wave var(--dur-wave) ease-in-out var(--dur-raise) infinite;
}

.is-waving #leftArm {
  animation: sway calc(var(--dur-wave) * 2) ease-in-out infinite;
}

.is-falling #rightArm {
  animation: armLower var(--dur-lower) ease-in forwards;
}

.is-down #rightArm {
  transform: rotate(-8deg);
}

.is-falling #leftArm,
.is-down #leftArm,
.is-standing #leftArm,
.is-standing #rightArm {
  animation: none;
}

.is-falling #robotFloat,
.is-down #robotFloat,
.is-standing #robotFloat,
.is-falling #body,
.is-down #body,
.is-standing #body,
.is-falling #head,
.is-down #head,
.is-standing #head {
  animation: none;
}

.is-falling #robot {
  animation: fall var(--dur-fall) cubic-bezier(0.55, 0.06, 0.78, 0.32) forwards;
}

.is-down #robot {
  transform: rotate(80deg) translate(24px, 28px);
}

.is-standing #robot {
  animation: stand var(--dur-stand) cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

.is-falling #shadow {
  animation: shadowFall var(--dur-fall) ease-out forwards;
}

.is-down #shadow {
  transform: scale(1.55, 0.62);
  opacity: 0.55;
}

.is-standing #shadow {
  animation: shadowFall var(--dur-stand) ease-in reverse forwards;
}

.is-falling #leftEye,
.is-falling #rightEye,
.is-down #leftEye,
.is-down #rightEye {
  animation: none;
  transform: scaleY(0.35);
}

#mouthSmile,
#mouthFrown {
  transition: opacity 0.18s ease;
}

.is-falling #mouthSmile,
.is-down #mouthSmile,
.is-standing #mouthSmile {
  opacity: 0;
}

.is-falling #mouthFrown,
.is-down #mouthFrown {
  opacity: 1;
}

.is-standing #mouthFrown {
  opacity: 0;
}

.is-paused * {
  animation-play-state: paused !important;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

@keyframes shadowBreathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.86, 0.9);
    opacity: 0.72;
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.018, 1.012);
  }
}

@keyframes headBob {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }

  50% {
    transform: rotate(-1.2deg) translateY(2px);
  }
}

@keyframes blink {
  0%,
  90%,
  100% {
    transform: scaleY(1);
  }

  93% {
    transform: scaleY(0.08);
  }

  96% {
    transform: scaleY(1);
  }
}

@keyframes armRaise {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(-108deg);
  }
}

@keyframes wave {
  0%,
  100% {
    transform: rotate(-108deg);
  }

  50% {
    transform: rotate(-134deg);
  }
}

@keyframes armLower {
  from {
    transform: rotate(-108deg);
  }

  to {
    transform: rotate(-8deg);
  }
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(0);
  }

  50% {
    transform: rotate(4deg);
  }
}

@keyframes fall {
  0% {
    transform: rotate(0) translate(0, 0);
  }

  55% {
    transform: rotate(46deg) translate(14px, 14px);
  }

  85% {
    transform: rotate(84deg) translate(26px, 30px);
  }

  100% {
    transform: rotate(80deg) translate(24px, 28px);
  }
}

@keyframes stand {
  0% {
    transform: rotate(80deg) translate(24px, 28px);
  }

  60% {
    transform: rotate(-6deg) translate(-2px, -4px);
  }

  100% {
    transform: rotate(0) translate(0, 0);
  }
}

@keyframes shadowFall {
  from {
    transform: scale(1);
    opacity: 1;
  }

  to {
    transform: scale(1.55, 0.62);
    opacity: 0.55;
  }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  min-height: 210px;
  padding: 20px;
  background: linear-gradient(150deg, rgba(5, 18, 32, 0.97), rgba(3, 14, 27, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-bright);
  box-shadow: 0 15px 32px rgba(0, 0, 0, 0.27);
}

.feature-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 15px;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: rgba(9, 57, 61, 0.5);
  border: 1px solid rgba(55, 218, 207, 0.18);
  border-radius: 10px;
}

.feature-card h4 {
  margin: 0;
  color: var(--teal);
  font-size: 18px;
  font-weight: 500;
}

.feature-line {
  width: 34px;
  height: 2px;
  margin: 11px 0 13px;
  background: linear-gradient(90deg, var(--teal), transparent);
}

.feature-card p {
  margin: 0;
  color: #67d99c;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
}

.workspace-section {
  padding: 18px;
  background: linear-gradient(145deg, rgba(4, 15, 29, 0.96), rgba(3, 13, 25, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.19);
}

.workspace-box {
  width: 100%;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(43, 109, 110, 0.8);
  border-radius: var(--radius-lg);
}

legend {
  padding: 0 10px;
  color: var(--cyan);
  font-size: 16px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone {
  min-height: 190px;
  padding: 25px;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(10, 55, 63, 0.14), transparent 55%),
    rgba(0, 8, 20, 0.62);
  border: 1px dashed rgba(55, 218, 207, 0.4);
  border-radius: 14px;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.upload-zone:hover,
.upload-zone.is-dragging {
  transform: translateY(-2px);
  border-color: rgba(55, 218, 207, 0.9);
  background:
    radial-gradient(circle at center, rgba(10, 79, 83, 0.19), transparent 58%),
    rgba(0, 11, 24, 0.72);
}

.upload-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: rgba(7, 62, 65, 0.55);
  border: 1px solid rgba(55, 218, 207, 0.2);
  border-radius: 13px;
  font-size: 21px;
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #8db1b5;
}

.file-name {
  max-width: 720px;
  color: var(--yellow);
  font-size: 20px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upload-content small {
  color: #66878c;
}

.action-row {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.mini-info {
  color: #75989d;
  font-size: 13px;
}

.mini-info i {
  margin-right: 5px;
  color: var(--success);
}

.button-loader {
  width: 15px;
  height: 15px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loadingSpin 0.7s linear infinite;
}

.primary-btn.is-loading .button-loader {
  display: block;
}

.primary-btn.is-loading .fa-solid {
  display: none;
}

@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}

.message-box,
.inline-status {
  max-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    opacity var(--transition),
    max-height var(--transition),
    padding var(--transition),
    margin var(--transition);
}

.message-box.is-visible {
  max-height: 90px;
  margin-top: 14px;
  padding: 11px 14px;
  display: flex;
  justify-content: center;
  color: #d8eeee;
  background: rgba(7, 29, 39, 0.8);
  border: 1px solid rgba(77, 133, 140, 0.35);
  border-radius: 10px;
  opacity: 1;
}

.message-box.is-success {
  color: #a7f4ce;
  background: rgba(9, 55, 42, 0.62);
  border-color: rgba(74, 225, 161, 0.3);
}

.message-box.is-error {
  color: #ffb3b8;
  background: rgba(65, 17, 27, 0.62);
  border-color: rgba(255, 110, 120, 0.35);
}

.section-header {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-header h3 {
  margin: 5px 0 0;
  color: #eaf9f8;
  font-size: 20px;
  font-weight: 500;
}

.section-header p {
  margin: 5px 0 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 300;
}

.dataset-meta {
  color: #8aabb0;
  font-size: 13px;
}

.table-box {
  min-height: 175px;
  max-height: 360px;
  overflow: auto;
  background: rgba(0, 7, 18, 0.72);
  border: 1px solid rgba(55, 96, 100, 0.52);
  border-radius: 12px;
}

.empty-state {
  min-height: 173px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #708f95;
  text-align: center;
}

.empty-state i {
  margin-bottom: 5px;
  color: rgba(25, 205, 187, 0.7);
  font-size: 28px;
}

.empty-state strong {
  color: #a5c6c7;
  font-weight: 500;
}

.empty-state span {
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(76, 105, 112, 0.2);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #c4f3ee;
  background: #0c2131;
  font-weight: 500;
}

td {
  color: #ccdcdc;
  background: rgba(4, 16, 30, 0.58);
  font-weight: 300;
}

tbody tr:hover td {
  background: rgba(8, 31, 48, 0.88);
}

.table-box::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-box::-webkit-scrollbar-track {
  background: #071321;
}

.table-box::-webkit-scrollbar-thumb {
  background: #204c50;
  border-radius: 20px;
}

.transform-toolbar,
.graph-toolbar,
.analysis-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 13px;
}

.transform-action-control {
  flex: 1;
}

.transform-target-control {
  flex: 1;
}

.control-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-block label {
  color: #789da2;
  font-size: 12px;
}

select {
  width: 100%;
  min-width: 185px;
  height: 44px;
  padding: 0 39px 0 13px;
  color: var(--yellow);
  background: var(--control);
  border: 1px solid rgba(52, 116, 117, 0.72);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

select:hover:not(:disabled) {
  border-color: rgba(55, 218, 207, 0.62);
}

select:focus {
  border-color: #e5b93c;
  box-shadow: 0 0 0 3px rgba(229, 185, 60, 0.1);
}

select:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

select option {
  color: var(--yellow);
  background: var(--control);
}

.toolbar-button {
  min-width: 140px;
  height: 44px;
  flex-shrink: 0;
}

.inline-status.is-visible {
  max-height: 80px;
  margin-top: 12px;
  padding: 10px 12px;
  color: #8ed6c2;
  background: rgba(6, 38, 40, 0.45);
  border-radius: 8px;
  opacity: 1;
}

.inline-status.is-error {
  color: #ffadb3;
  background: rgba(65, 17, 27, 0.52);
}

.graph-toolbar .control-block {
  flex: 1;
}

.graph-output {
  min-height: 320px;
  margin-top: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(24, 70, 76, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 70, 76, 0.045) 1px, transparent 1px),
    rgba(0, 8, 20, 0.62);
  background-size: 28px 28px;
  border: 1px dashed rgba(55, 218, 207, 0.28);
  border-radius: 13px;
}

.graph-output img {
  max-width: 100%;
  max-height: 620px;
  display: block;
  object-fit: contain;
}

.graph-empty {
  min-height: 300px;
}

.analysis-type-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
}

.analysis-type {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  background: rgba(2, 14, 27, 0.58);
  border: 1px solid rgba(45, 101, 104, 0.56);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.analysis-type:hover {
  transform: translateY(-1px);
  border-color: rgba(55, 218, 207, 0.5);
}

.analysis-type:has(input:checked) {
  background: rgba(6, 67, 70, 0.55);
  border-color: rgba(55, 218, 207, 0.7);
}

.analysis-type input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.analysis-radio {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 2px solid #71989c;
  border-radius: 50%;
}

.analysis-radio::after {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--teal);
  border-radius: 50%;
  transform: scale(0);
  transition: transform var(--transition);
}

.analysis-type input:checked + .analysis-radio::after {
  transform: scale(1);
}

.analysis-controls {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.analysis-controls .control-block {
  flex: 1;
}

.analysis-controls.is-hidden {
  display: none;
}

.analysis-controls.is-visible {
  animation: controlReveal 0.22s ease both;
}

@keyframes controlReveal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.predict-button {
  min-width: 145px;
}

.analysis-output {
  min-height: 210px;
  margin-top: 18px;
  padding: 18px;
  background: rgba(0, 8, 20, 0.58);
  border: 1px solid rgba(53, 100, 105, 0.42);
  border-radius: 13px;
}

.analysis-output .empty-state {
  min-height: 172px;
}

.result-header {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.result-header div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.result-header h3 {
  margin: 0;
  color: #e7fafa;
  font-size: 19px;
  font-weight: 500;
}

.result-header span {
  color: #76999e;
  font-size: 12px;
}

.result-badge {
  padding: 5px 10px;
  color: #87e8c8;
  background: rgba(10, 76, 67, 0.52);
  border: 1px solid rgba(74, 225, 161, 0.22);
  border-radius: 999px;
  font-size: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 11px;
}

.result-card {
  min-height: 90px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, rgba(6, 27, 39, 0.82), rgba(2, 18, 29, 0.82));
  border: 1px solid rgba(48, 102, 105, 0.48);
  border-radius: 11px;
}

.result-card-label {
  margin-bottom: 7px;
  color: #769a9e;
  font-size: 11px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.result-card-value {
  color: var(--yellow);
  font-size: 18px;
  font-weight: 500;
  word-break: break-word;
}

.result-primary {
  grid-column: span 2;
  background: linear-gradient(145deg, rgba(7, 58, 61, 0.82), rgba(4, 31, 40, 0.82));
  border-color: rgba(55, 218, 207, 0.32);
}

.result-primary .result-card-value {
  color: #8fffe8;
  font-size: 25px;
}

.result-message {
  margin-top: 13px;
  padding: 12px 14px;
  color: #8dd4ba;
  background: rgba(5, 44, 38, 0.38);
  border-left: 3px solid var(--teal);
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.6;
}

.footer {
  padding: 27px 20px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #71979b;
  text-align: center;
  border-top: 1px solid rgba(29, 50, 51, 0.65);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-family: "Libertinus Serif", serif;
  font-weight: 700;
}

.footer p {
  margin: 0;
  font-size: 13px;
}

.footer a {
  color: #8dceb8;
  font-size: 13px;
}

@media (max-width: 1050px) {
  .hero-section {
    grid-template-columns: 1fr;
  }

  .hero-content {
    text-align: center;
  }

  .hero-content p {
    margin-inline: auto;
  }

  .hero-tech {
    justify-content: center;
  }

  .robot-stage {
    width: 270px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .transform-toolbar,
  .graph-toolbar,
  .analysis-toolbar {
    flex-wrap: wrap;
  }

  .analysis-controls {
    flex-basis: 100%;
  }
}

@media (max-width: 720px) {
  .header {
    padding: 11px 15px;
  }

  .nav a {
    display: none;
  }

  .page-shell {
    width: calc(100% - 18px);
    margin-top: 18px;
  }

  .hero-section {
    padding: 13px;
  }

  .hero-content {
    padding: 14px 8px;
  }

  .hero-content h2 {
    font-size: 34px;
  }

  .hero-content p {
    font-size: 15px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: auto;
  }

  .action-row,
  .section-header,
  .transform-toolbar,
  .graph-toolbar,
  .analysis-toolbar,
  .analysis-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .section-header {
    align-items: flex-start;
  }

  .analysis-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .analysis-type {
    justify-content: center;
  }

  select,
  .primary-btn {
    width: 100%;
  }

  .result-primary {
    grid-column: span 1;
  }

  .file-name {
    max-width: 260px;
  }
}

@media (max-width: 460px) {
  .hero-content h2 {
    font-size: 29px;
  }

  .robot-stage {
    width: 225px;
  }

  .analysis-type-selector {
    grid-template-columns: 1fr;
  }

  .upload-zone {
    min-height: 170px;
    padding: 18px 12px;
  }
}

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

  #robotFloat,
  #shadow,
  #body,
  #head,
  #leftEye,
  #rightEye,
  #leftArm,
  #rightArm,
  #robot {
    animation: none !important;
  }
}
/* =========================================================
   Adaptive parameter workbench
   ========================================================= */
.secondary-btn,
.icon-btn {
  color: #a8e6db;
  background: rgba(5, 30, 39, 0.78);
  border: 1px solid rgba(55, 218, 207, 0.32);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), opacity var(--transition);
}

.secondary-btn:hover:not(:disabled),
.icon-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(8, 50, 56, 0.9);
  border-color: rgba(55, 218, 207, 0.65);
}

.secondary-btn:disabled,
.icon-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.compact-btn {
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
}

.dataset-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.adaptive-workbench {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(0, 2.2fr) auto;
  gap: 14px;
  align-items: start;
}

.primary-selector {
  position: sticky;
  top: 84px;
  z-index: 3;
}

.dynamic-params {
  min-height: 76px;
  padding: 13px;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
  background: rgba(0, 10, 22, 0.52);
  border: 1px solid rgba(45, 92, 99, 0.42);
  border-radius: 12px;
}

.analysis-dynamic-params {
  flex: 1 1 100%;
}

.dynamic-control {
  min-width: 0;
  padding: 10px;
  background: rgba(4, 19, 31, 0.72);
  border: 1px solid rgba(39, 87, 91, 0.42);
  border-radius: 10px;
  animation: controlReveal 0.2s ease both;
}

.dynamic-control.param-hidden {
  display: none;
}

.dynamic-control input[type="text"],
.dynamic-control input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  color: var(--yellow);
  background: var(--control);
  border: 1px solid rgba(52, 116, 117, 0.72);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.dynamic-control input[type="text"]:focus,
.dynamic-control input[type="number"]:focus {
  border-color: #e5b93c;
  box-shadow: 0 0 0 3px rgba(229, 185, 60, 0.1);
}

.required-mark {
  margin-left: 4px;
  color: var(--cyan);
}

.optional-mark {
  margin-left: 4px;
  color: #587a80;
  font-size: 10px;
  font-weight: 400;
}

.control-help {
  color: #678b91;
  font-size: 10px;
  font-weight: 300;
  line-height: 1.45;
}

.parameter-placeholder {
  min-height: 50px;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #5f858b;
  text-align: center;
  font-size: 12px;
}

.parameter-placeholder i {
  color: #2fa99d;
}

.workbench-action {
  min-width: 145px;
  display: flex;
  align-items: flex-end;
}

.workbench-action .toolbar-button {
  width: 100%;
}

.range-control {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 46px;
  gap: 10px;
  align-items: center;
}

.range-control input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.range-control output {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: var(--yellow);
  background: rgba(2, 18, 29, 0.9);
  border: 1px solid rgba(52, 116, 117, 0.58);
  border-radius: 7px;
  font-size: 12px;
}

.toggle-control {
  min-height: 44px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  cursor: pointer;
}

.toggle-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-slider {
  width: 42px;
  height: 23px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  background: #19333b;
  border: 1px solid rgba(87, 131, 136, 0.48);
  border-radius: 999px;
  transition: background var(--transition), border-color var(--transition);
}

.toggle-slider::before {
  content: "";
  width: 15px;
  height: 15px;
  background: #7c989c;
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}

.toggle-control input:checked + .toggle-slider {
  background: rgba(10, 83, 78, 0.88);
  border-color: rgba(55, 218, 207, 0.62);
}

.toggle-control input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: var(--teal);
}

.toggle-state {
  color: #9dc8c7;
  font-size: 12px;
}

.column-picker {
  position: relative;
  color: var(--yellow);
}

.column-picker summary {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  background: var(--control);
  border: 1px solid rgba(52, 116, 117, 0.72);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}

.column-picker summary::-webkit-details-marker {
  display: none;
}

.column-picker summary::after {
  content: "+";
  color: var(--teal);
  font-size: 18px;
  line-height: 1;
}

.column-picker[open] summary::after {
  content: "−";
}

.checkbox-grid {
  max-height: 220px;
  margin-top: 7px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  overflow: auto;
  background: #03121e;
  border: 1px solid rgba(52, 116, 117, 0.54);
  border-radius: 9px;
}

.checkbox-option {
  min-width: 0;
  padding: 7px 8px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 7px !important;
  color: #a9cecc !important;
  background: rgba(7, 31, 40, 0.62);
  border: 1px solid rgba(41, 81, 84, 0.4);
  border-radius: 7px;
  cursor: pointer;
}

.checkbox-option:hover {
  border-color: rgba(55, 218, 207, 0.46);
}

.checkbox-option input {
  accent-color: var(--teal);
}

.checkbox-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adaptive-analysis-toolbar {
  align-items: stretch;
  flex-wrap: wrap;
}

.adaptive-analysis-toolbar .analysis-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, 0.68fr) minmax(0, 2.32fr);
  gap: 14px;
  align-items: start;
}

.adaptive-analysis-toolbar .analysis-controls.is-hidden {
  display: none;
}

.analysis-action {
  margin-left: auto;
}

.summary-panel {
  margin-top: 16px;
  padding: 16px;
  background: rgba(1, 12, 24, 0.86);
  border: 1px solid rgba(55, 218, 207, 0.24);
  border-radius: 13px;
  animation: controlReveal 0.22s ease both;
}

.summary-panel.is-hidden {
  display: none;
}

.summary-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.summary-header h4 {
  margin: 3px 0 0;
  color: #e9ffff;
  font-size: 18px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  min-width: 0;
  padding: 12px;
  background: rgba(4, 20, 31, 0.72);
  border: 1px solid rgba(40, 88, 92, 0.43);
  border-radius: 10px;
}

.summary-card h5 {
  margin: 0 0 9px;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.35px;
}

.summary-kv {
  max-height: 230px;
  overflow: auto;
}

.summary-kv > div {
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(49, 92, 95, 0.22);
}

.summary-kv > div:last-child {
  border-bottom: 0;
}

.summary-kv span,
.muted-value {
  color: #73969b;
  font-size: 11px;
}

.summary-kv strong,
.summary-scalar {
  color: #d9f1e8;
  font-size: 12px;
  text-align: right;
}

.summary-error {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #ffadb3;
}

.raw-result {
  margin-top: 14px;
  color: #9bd6ca;
  background: rgba(2, 13, 25, 0.72);
  border: 1px solid rgba(50, 98, 103, 0.4);
  border-radius: 9px;
}

.raw-result summary {
  padding: 10px 12px;
  cursor: pointer;
}

.raw-result pre {
  max-height: 320px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #c6d9d6;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid rgba(50, 98, 103, 0.32);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

@media (max-width: 980px) {
  .adaptive-workbench {
    grid-template-columns: 1fr;
  }

  .primary-selector {
    position: static;
  }

  .dynamic-params,
  .adaptive-analysis-toolbar .analysis-controls {
    grid-template-columns: 1fr 1fr;
  }

  .adaptive-analysis-toolbar .analysis-controls .primary-selector,
  .analysis-dynamic-params {
    grid-column: 1 / -1;
  }

  .workbench-action,
  .analysis-action {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .dynamic-params,
  .adaptive-analysis-toolbar .analysis-controls,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .adaptive-analysis-toolbar .analysis-controls .primary-selector,
  .analysis-dynamic-params {
    grid-column: auto;
  }

  .dataset-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Data browser, exports, chart polish & crash-safe feedback
   ========================================================= */
.dataset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dataset-browser {
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(2, 16, 28, 0.8);
  border: 1px solid rgba(55, 218, 207, 0.2);
  border-radius: 10px;
}

.dataset-browser.is-hidden {
  display: none;
}

.browser-note {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6f979c;
  font-size: 11px;
  line-height: 1.4;
}

.browser-note i {
  color: var(--teal);
}

.browser-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.browser-controls label {
  color: #75999f;
  font-size: 11px;
}

.browser-controls select {
  width: 78px;
  min-width: 78px;
  height: 34px;
  padding: 0 25px 0 9px;
  font-size: 11px;
}

.page-btn {
  width: 32px;
  height: 32px;
}

.page-status {
  min-width: 235px;
  color: #a9d9d5;
  text-align: center;
  font-size: 11px;
}

.table-box {
  max-height: 430px;
  contain: layout paint;
}

.table-box.is-loading-page {
  opacity: 0.65;
  pointer-events: none;
}

.table-box td {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Generated figures should feel like a component of DataForge rather than a white notebook plot. */
.graph-output {
  width: min(100%, 900px);
  min-height: 240px;
  margin: 18px auto 0;
  padding: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(22, 113, 116, 0.08), transparent 55%),
    rgba(1, 11, 22, 0.82);
  border-style: solid;
  border-color: rgba(55, 218, 207, 0.2);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.18), 0 12px 32px rgba(0, 0, 0, 0.16);
}

.graph-output img {
  width: min(100%, 820px);
  max-height: 500px;
  border-radius: 9px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.26);
}

.graph-empty {
  min-height: 210px;
}

.toast-host {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 9999;
  width: min(390px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.app-toast {
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: start;
  color: #cfe8e7;
  background: rgba(3, 20, 32, 0.97);
  border: 1px solid rgba(55, 218, 207, 0.3);
  border-radius: 10px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: auto;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.is-success {
  border-color: rgba(74, 225, 161, 0.45);
}

.app-toast.is-success i {
  color: var(--success);
}

.app-toast.is-error {
  border-color: rgba(255, 115, 124, 0.48);
}

.app-toast.is-error i {
  color: var(--error);
}

.app-toast.is-info i {
  color: var(--cyan);
}

@media (max-width: 820px) {
  .dataset-browser {
    align-items: stretch;
    flex-direction: column;
  }

  .browser-controls {
    flex-wrap: wrap;
  }

  .page-status {
    min-width: 180px;
  }

  .dataset-actions {
    justify-content: flex-start;
  }
}
