:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #f8fbfd;
  --ink: #152033;
  --text: #263852;
  --muted: #61718a;
  --border: #d4e0ec;
  --border-strong: #b8c9dc;
  --teal: #148671;
  --blue: #2f73c9;
  --red: #c84a3b;
  --amber: #b47500;
  --violet: #7159c9;
  --shadow: 0 12px 30px rgba(31, 51, 80, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 243, 248, 0.88) 320px),
    var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.brand,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #007d68;
  background: #eefaf7;
  border: 1px solid #b9d9d3;
  border-radius: 8px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand h1,
.brand p,
.hero-band h2,
.panel-heading h3,
.empty-state h3,
.loading-state h3 {
  margin: 0;
}

.brand h1 {
  font-size: 1.28rem;
  line-height: 1.1;
}

.brand p {
  margin-top: 3px;
  color: #526783;
  font-size: 0.92rem;
}

.status-pill,
.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.86rem;
  text-decoration: none;
}

.status-pill {
  color: #5d4300;
  background: #fff4d9;
  border: 1px solid #ead18e;
}

.status-pill.online {
  color: #0e624f;
  background: #e8f7f2;
  border-color: #b8ded4;
}

.status-pill.offline {
  color: #8a2522;
  background: #fff0ed;
  border-color: #efc0b9;
}

.ghost-link {
  color: #274a72;
  background: #f3f7fb;
  border: 1px solid var(--border);
}

main {
  max-width: 1680px;
  margin: 0 auto;
  padding: 22px 24px 54px;
}

.site-footer {
  max-width: 1680px;
  margin: -28px auto 0;
  padding: 0 24px 26px;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
}

.site-footer a {
  color: #274a72;
  font-weight: 800;
}

.creator-page {
  max-width: 1180px;
}

.creator-hero {
  margin-bottom: 18px;
}

.creator-profile {
  padding: 24px;
}

.creator-profile h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.creator-profile p {
  max-width: 840px;
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

.creator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.creator-actions a {
  text-decoration: none;
}

.file-warning,
.warning-note {
  border: 1px solid #f0d397;
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff8ea;
  color: #5b4212;
  margin-bottom: 16px;
}

.file-warning a {
  color: #174f88;
  font-weight: 800;
}

.warning-note {
  margin-top: 0;
}

.warning-note p {
  margin: 0;
}

.warning-note p + p {
  margin-top: 8px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 24px;
  color: #ffffff;
  background:
    linear-gradient(120deg, rgba(18, 85, 116, 0.96), rgba(29, 111, 99, 0.96)),
    #125574;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: #bfe8df;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-band h2 {
  max-width: 880px;
  font-size: clamp(1.55rem, 2vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-band p:not(.eyebrow) {
  max-width: 940px;
  margin: 12px 0 0;
  color: #d8eeeb;
}

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

.hero-stats div {
  display: grid;
  align-content: center;
  min-height: 120px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
}

.hero-stats strong {
  font-size: 1.34rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.hero-stats span {
  margin-top: 8px;
  color: #d8eeeb;
  font-size: 0.84rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.control-column,
.dashboard-column,
.results {
  display: grid;
  gap: 16px;
  align-content: start;
}

.control-column {
  position: sticky;
  top: 96px;
}

.panel,
.metric-card,
.empty-state,
.loading-state {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(24, 37, 58, 0.04);
}

.panel,
.empty-state,
.loading-state {
  padding: 16px;
}

.control-panel {
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h3 {
  font-size: 1rem;
  line-height: 1.2;
}

.panel-kicker,
.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.panel-kicker {
  display: block;
  margin-bottom: 3px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.field,
.slider-field {
  display: grid;
  gap: 7px;
}

.field + .field,
.field-grid + .field,
.example-card + .field-grid,
.field + .composition-strip {
  margin-top: 12px;
}

.field span,
.slider-field span {
  color: #31425b;
  font-size: 0.86rem;
  font-weight: 850;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

input,
textarea,
select {
  min-width: 0;
  border: 1px solid #c7d5e5;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  min-height: 190px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(47, 115, 201, 0.22);
  border-color: var(--blue);
}

.example-card {
  margin-top: 12px;
  padding: 11px;
  background: #f2f8fb;
  border: 1px solid #d0e2ee;
  border-radius: 8px;
}

.example-card strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
}

.example-card span {
  display: inline-flex;
  margin: 8px 0;
  padding: 3px 7px;
  border-radius: 999px;
  color: #22515a;
  background: #e7f5f1;
  font-size: 0.76rem;
  font-weight: 850;
}

.example-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.composition-strip div {
  padding: 8px;
  background: var(--panel-soft);
  border: 1px solid #e0e9f2;
  border-radius: 7px;
}

.composition-strip strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
}

.composition-strip span {
  color: var(--muted);
  font-size: 0.72rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.mode-button,
.tab-button,
.download-card {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  font-weight: 850;
}

.primary-button {
  color: #ffffff;
  background: #126f61;
  box-shadow: 0 8px 18px rgba(18, 111, 97, 0.22);
}

.primary-button:hover {
  background: #0f6256;
}

.button-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #a9f3e0;
}

.primary-button.is-running .button-dot {
  animation: pulse 0.8s infinite alternate;
}

.secondary-button,
.mode-button,
.tab-button {
  color: #24364f;
  background: #ffffff;
  border-color: #cbd7e6;
}

.secondary-button:hover,
.mode-button:hover,
.tab-button:hover {
  border-color: #9fb6cf;
  background: #f7fafc;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.mode-button.active,
.tab-button.active {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.slider-stack {
  display: grid;
  gap: 13px;
}

.slider-field span {
  display: flex;
  justify-content: space-between;
}

.slider-field strong {
  color: var(--text);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--blue);
}

.error-box {
  margin-top: 12px;
  padding: 10px 12px;
  color: #842021;
  background: #fff0f0;
  border: 1px solid #f0b9b9;
  border-radius: 6px;
}

.hidden {
  display: none !important;
}

.empty-state,
.loading-state {
  min-height: 250px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state h3,
.loading-state h3 {
  color: var(--ink);
  font-size: 1.18rem;
}

.empty-state p,
.loading-state p {
  max-width: 520px;
  margin: 8px 0 0;
}

.empty-visual {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 8px;
  margin-bottom: 18px;
}

.empty-visual span {
  height: 92px;
  border-radius: 8px;
  background: #d9e7f2;
  animation: equalize 1.6s infinite ease-in-out;
}

.empty-visual span:nth-child(2) {
  animation-delay: 0.16s;
  background: #d9ede7;
}

.empty-visual span:nth-child(3) {
  animation-delay: 0.32s;
  background: #f1dfbd;
}

.empty-visual span:nth-child(4) {
  animation-delay: 0.48s;
  background: #efd8d5;
}

.loading-state {
  grid-template-columns: auto minmax(0, 420px);
  justify-content: center;
  text-align: left;
  gap: 18px;
}

.loader-ring {
  width: 54px;
  height: 54px;
  border: 5px solid #d8e6f3;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  min-height: 150px;
  padding: 14px;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--metric-color, var(--blue));
  transform-origin: left;
  animation: growX 0.7s ease-out both;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  color: #49627f;
}

.metric-card h3 {
  margin: 12px 0 6px;
  color: #34465d;
  font-size: 0.9rem;
}

.metric-context {
  display: block;
  min-height: 17px;
  margin-bottom: 6px;
  color: #61738d;
  font-size: 0.74rem;
  font-weight: 800;
}

.metric-card strong {
  color: var(--ink);
  font-size: 1.9rem;
  line-height: 1;
}

.metric-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.label {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  max-width: 120px;
  text-align: center;
  line-height: 1.15;
}

.high {
  color: #9d2f22;
  background: #ffe9e5;
}

.moderate {
  color: #744c00;
  background: #fff3d8;
}

.low {
  color: #136553;
  background: #e9f7f2;
}

.result-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeUp 0.22s ease-out;
}

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

.bar-chart {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(128px, 180px) 1fr 52px;
  align-items: center;
  gap: 12px;
  color: #31425b;
  font-size: 0.86rem;
}

.bar-track {
  height: 15px;
  overflow: hidden;
  background: #eef3f8;
  border: 1px solid #dae5ef;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transform-origin: left;
  animation: growX 0.7s ease-out both;
}

.bar-fill.aggregation {
  background: var(--red);
}

.bar-fill.llps {
  background: var(--blue);
}

.bar-fill.assembly,
.bar-fill.disorder {
  background: var(--teal);
}

.bar-fill.importance {
  background: var(--violet);
}

.track-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #52657d;
  font-size: 0.84rem;
  margin-bottom: 12px;
}

.track-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.track-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.track-legend .agg {
  background: rgba(200, 74, 59, 0.78);
}

.track-legend .llps {
  background: rgba(47, 115, 201, 0.78);
}

.track-legend .disorder {
  background: rgba(20, 134, 113, 0.78);
}

.track-legend .complexity {
  background: rgba(180, 117, 0, 0.78);
}

.track-shell {
  position: relative;
}

.sequence-tracks {
  display: grid;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.track-row {
  display: grid;
  grid-template-columns: 130px minmax(520px, 1fr);
  gap: 10px;
  align-items: center;
}

.track-label {
  color: #31425b;
  font-size: 0.84rem;
  font-weight: 900;
}

.track-cells {
  display: grid;
  height: 20px;
  overflow: hidden;
  border: 1px solid #e3e9f2;
  border-radius: 5px;
  background: #f8fafc;
}

.track-cell {
  min-width: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.track-cell:hover {
  filter: saturate(1.35) brightness(0.95);
  transform: scaleY(1.2);
}

.track-tooltip {
  position: fixed;
  z-index: 50;
  max-width: 230px;
  padding: 9px 10px;
  color: #ffffff;
  background: rgba(21, 32, 51, 0.94);
  border-radius: 8px;
  font-size: 0.78rem;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.track-tooltip strong {
  display: block;
  margin-bottom: 4px;
}

.sequence-ruler {
  display: flex;
  justify-content: space-between;
  padding-left: 140px;
  color: var(--muted);
  font-size: 0.78rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 9px;
  text-align: left;
  border-bottom: 1px solid #e2e9f2;
  font-size: 0.86rem;
}

th {
  color: #34465d;
  background: #f6f9fc;
}

tbody tr:hover {
  background: #f8fbfd;
}

.structure-panel {
  min-height: 520px;
}

.structure-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(110px, 0.8fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.structure-toolbar label {
  display: grid;
  gap: 6px;
}

.structure-toolbar span {
  color: #31425b;
  font-size: 0.8rem;
  font-weight: 850;
}

.structure-viewer {
  position: relative;
  height: 330px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(240, 246, 251, 0.96)),
    #f8fbfd;
  border: 1px solid #d9e5ef;
  border-radius: 8px;
}

.structure-viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.structure-regions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.structure-region-legend,
.structure-region-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.structure-region-legend span,
.structure-region-list li,
.structure-region-empty {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfd;
}

.structure-region-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: #334761;
  font-size: 0.78rem;
  font-weight: 850;
}

.structure-region-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.structure-region-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.structure-region-list li {
  min-width: 155px;
  padding: 9px 10px;
  border-top: 4px solid var(--region-color, var(--border-strong));
}

.structure-region-list li.aggregation {
  --region-color: var(--red);
}

.structure-region-list li.llps {
  --region-color: var(--blue);
}

.structure-region-list li.disorder {
  --region-color: var(--teal);
}

.structure-region-list li.complexity {
  --region-color: var(--amber);
}

.structure-region-list strong,
.structure-region-list span,
.structure-region-list em,
.structure-region-list small {
  display: block;
}

.structure-region-source {
  color: #31425b;
  font-size: 0.84rem;
  font-weight: 850;
}

.structure-region-list strong {
  color: var(--text);
  font-size: 0.84rem;
}

.structure-region-list span {
  margin-top: 2px;
  color: var(--ink);
  font-weight: 900;
}

.structure-region-list em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.structure-region-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.structure-region-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.structure-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.structure-empty p {
  max-width: 420px;
  margin: 0;
}

.protein-ribbon {
  width: 142px;
  height: 78px;
  border: 4px solid var(--blue);
  border-left-color: var(--teal);
  border-right-color: var(--red);
  border-radius: 50%;
  transform: rotate(-12deg);
  animation: floatRibbon 2.8s ease-in-out infinite;
}

.structure-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.download-card {
  min-height: 96px;
  display: grid;
  align-content: center;
  justify-items: start;
  text-align: left;
  color: var(--text);
  background: #f8fbfd;
  border: 1px solid var(--border);
}

.download-card:hover {
  background: #eef6fb;
  border-color: var(--border-strong);
}

.download-card strong {
  font-size: 1rem;
}

.download-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

@keyframes growX {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  from {
    opacity: 0.45;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes equalize {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes floatRibbon {
  0%,
  100% {
    transform: rotate(-12deg) translateY(0);
  }
  50% {
    transform: rotate(-8deg) translateY(-8px);
  }
}

@media (max-width: 1120px) {
  .hero-band,
  .workspace,
  .chart-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .control-column {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar,
  .brand,
  .topbar-actions {
    align-items: flex-start;
  }

  .topbar {
    position: static;
    flex-direction: column;
  }

  main {
    padding: 16px;
  }

  .hero-band {
    padding: 18px;
  }

  .hero-stats,
  .metric-grid,
  .field-grid,
  .mode-tabs,
  .download-cards,
  .structure-toolbar {
    grid-template-columns: 1fr;
  }

  .loading-state {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .bar-row,
  .track-row {
    grid-template-columns: 1fr;
  }

  .sequence-ruler {
    padding-left: 0;
  }
}
