:root {
  color-scheme: dark;
  --bg: #101412;
  --panel: #171d19;
  --panel-raised: #1c241f;
  --line: #303a33;
  --line-soft: #27302a;
  --text: #f1f2e9;
  --muted: #a1aaa0;
  --faint: #707b71;
  --accent: #c8f36a;
  --accent-dark: #9dc24d;
  --orange: #ffae68;
  --red: #ff8277;
  --mono: "DM Mono", Consolas, monospace;
  --sans: "Segoe UI", "Noto Sans Georgian", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 76% 0%, rgba(113, 151, 69, 0.11), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 54px 28px;
}

.topbar {
  min-height: 77px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-decoration: none;
}

.wordmark b,
footer b {
  color: var(--accent);
}

.wordmark-mark {
  height: 17px;
  display: inline-flex;
  align-items: end;
  gap: 2px;
}

.wordmark-mark i {
  width: 4px;
  border-radius: 3px 3px 1px 1px;
  background: var(--accent);
}

.wordmark-mark i:nth-child(1) { height: 8px; opacity: 0.56; }
.wordmark-mark i:nth-child(2) { height: 13px; opacity: 0.8; }
.wordmark-mark i:nth-child(3) { height: 17px; }

.local-badge,
.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: #bac4b9;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.035em;
}

.local-badge > span,
.state-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(200, 243, 106, 0.55);
  content: "";
}

.hero {
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 750px;
  padding: 39px 0 43px;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.eyebrow span {
  margin-left: 12px;
  color: var(--faint);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 13px;
  font-size: clamp(32px, 4vw, 51px);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-lede {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-orbit {
  position: absolute;
  top: 50%;
  right: 28px;
  width: 210px;
  height: 210px;
  transform: translateY(-50%);
  opacity: 0.85;
}

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(200, 243, 106, 0.16);
  border-radius: 50%;
}

.ring-one {
  inset: 14px;
  transform: rotate(-25deg) scaleX(0.72);
}

.ring-two {
  inset: 25px;
  transform: rotate(53deg) scaleX(0.72);
}

.orbit-core {
  position: absolute;
  inset: 65px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200, 243, 106, 0.35);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 243, 106, 0.13), rgba(200, 243, 106, 0.02) 70%);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 24px;
  box-shadow: 0 0 55px rgba(200, 243, 106, 0.08);
}

.orbit-core sub {
  font-size: 11px;
}

.orbit-dot {
  position: absolute;
  top: 35px;
  right: 45px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
}

.notice {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 22px 0 21px;
  padding: 10px 14px;
  border: 1px solid rgba(200, 243, 106, 0.14);
  border-radius: 7px;
  background: rgba(200, 243, 106, 0.035);
}

.notice-icon {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(200, 243, 106, 0.5);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.notice p {
  flex: 1;
  margin: 0;
  color: #c2cabe;
  font-size: 12px;
}

.state-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-color: rgba(200, 243, 106, 0.2);
  color: var(--accent);
  font-size: 9px;
}

.state-wait::before {
  background: var(--orange);
  box-shadow: 0 0 8px rgba(255, 174, 104, 0.5);
}

.state-error {
  border-color: rgba(255, 130, 119, 0.28);
  color: var(--red);
}

.state-error::before {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 130, 119, 0.45);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.82fr) minmax(0, 1.55fr);
  align-items: start;
  gap: 20px;
}

.controls-panel,
.results-panel {
  min-width: 0;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(28, 36, 31, 0.96), rgba(22, 28, 24, 0.96));
}

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

.panel-heading .eyebrow {
  margin-bottom: 5px;
  font-size: 9px;
}

.panel-heading h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.panel-index {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: #dfe4d9;
  font-size: 11px;
  font-weight: 700;
}

textarea,
input[type="number"],
input[type="password"],
select {
  width: 100%;
  border: 1px solid #39443b;
  border-radius: 5px;
  outline: none;
  background: #121713;
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  resize: vertical;
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.55;
}

select {
  min-height: 39px;
  padding: 8px 12px;
  font-size: 12px;
  color-scheme: dark;
}

input[type="password"] {
  height: 39px;
  padding: 0 11px;
  font-family: var(--mono);
  font-size: 12px;
}

textarea:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(200, 243, 106, 0.08);
}

textarea:disabled,
input[type="number"]:disabled,
input[type="password"]:disabled,
select:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

#models {
  min-height: 80px;
  font-family: var(--mono);
  font-size: 11px;
}

.field-hint,
.character-row {
  color: var(--faint);
  font-size: 10px;
}

.field-hint {
  margin: 6px 0 20px;
}

.prompt-label {
  margin-top: 0;
}

.character-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 17px;
}

.character-row span:last-child {
  color: #808a7f;
  font-family: var(--mono);
}

.number-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.number-input {
  position: relative;
}

input[type="number"] {
  height: 42px;
  padding: 0 92px 0 11px;
  font-family: var(--mono);
  font-size: 13px;
}

.number-input span {
  position: absolute;
  top: 50%;
  right: 9px;
  overflow: hidden;
  max-width: 85px;
  color: #879287;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
  pointer-events: none;
}

.call-estimate {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 13px;
  color: #adb7aa;
  font-size: 10px;
}

.call-estimate b {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.estimate-mark {
  color: var(--orange);
  font-size: 15px;
}

.start-button {
  width: 100%;
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #182014;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: background 120ms ease, transform 120ms ease, opacity 120ms ease;
}

.start-button:hover:not(:disabled) {
  background: #d7ff84;
  transform: translateY(-1px);
}

.start-button:disabled {
  border-color: #48523d;
  background: #394331;
  color: #aeb9a2;
  cursor: not-allowed;
}

.button-symbol {
  font-size: 10px;
}

.button-arrow {
  margin-left: auto;
  padding-right: 13px;
  font-size: 16px;
}

.billing-note {
  margin: 10px 0 0;
  color: #838d82;
  font-size: 10px;
  line-height: 1.6;
}

.billing-note strong {
  color: var(--orange);
}

.results-panel {
  padding: 23px;
}

.results-heading {
  align-items: center;
  margin-bottom: 17px;
}

.result-actions {
  display: flex;
  gap: 7px;
}

.quiet-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: #b1baaf;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9px;
  transition: border-color 120ms ease, color 120ms ease;
}

.quiet-button:hover:not(:disabled) {
  border-color: #82905d;
  color: var(--accent);
}

.quiet-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 9px;
}

.metric-card {
  min-width: 0;
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: rgba(12, 17, 13, 0.46);
}

.metric-primary {
  border-color: rgba(200, 243, 106, 0.28);
  background: linear-gradient(140deg, rgba(200, 243, 106, 0.095), rgba(12, 17, 13, 0.55));
}

.metric-label,
.metric-foot {
  color: var(--faint);
  font-size: 9px;
}

.metric-label {
  font-family: var(--mono);
  letter-spacing: 0.025em;
}

.metric-card strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(19px, 2.2vw, 27px);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-primary strong {
  color: var(--accent);
}

.metric-card strong small {
  color: var(--faint);
  font-size: 12px;
}

.run-status {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #869184;
  font-size: 10px;
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #586356;
}

.run-status.running {
  color: var(--accent);
}

.run-status.running .status-pulse {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(200, 243, 106, 0.8);
  animation: pulse 1s ease-in-out infinite alternate;
}

.run-status.failed {
  color: var(--red);
}

.run-status.failed .status-pulse {
  background: var(--red);
}

@keyframes pulse {
  to { opacity: 0.35; transform: scale(0.75); }
}

.chart-card {
  padding: 16px 15px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(12, 17, 13, 0.38);
}

.subsection-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.subsection-heading h3 {
  margin: 0 0 3px;
  font-size: 12px;
}

.subsection-heading p {
  margin: 0;
  color: var(--faint);
  font-size: 9px;
}

.chart-unit,
.trial-count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.empty-chart {
  min-height: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #737e73;
  font-size: 10px;
}

.empty-glyph {
  color: #82945b;
  font-family: var(--mono);
  font-size: 24px;
}

.chart-list {
  display: grid;
  gap: 13px;
  margin-top: 17px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.8fr) minmax(60px, 2fr) 62px;
  align-items: center;
  gap: 10px;
}

.chart-model {
  overflow: hidden;
  color: #c5cec2;
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 8px;
  background: #273029;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #8daf48, var(--accent));
  transition: width 250ms ease;
}

.chart-value {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.table-wrap {
  margin-top: 18px;
}

.table-title {
  align-items: center;
  margin-bottom: 8px;
}

.table-title h3 {
  font-size: 11px;
}

.table-title p {
  font-size: 9px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  text-align: left;
}

thead {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

th {
  padding: 9px 7px;
  color: #7f8a7e;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

td {
  padding: 9px 7px;
  border-bottom: 1px solid rgba(48, 58, 51, 0.62);
  color: #c2cbc0;
  vertical-align: top;
}

td:first-child,
td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
  font-family: var(--mono);
  font-size: 9px;
}

td:nth-child(2) {
  max-width: 150px;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 9px;
}

.placeholder-row td {
  padding: 17px 7px;
  color: #738073;
  font-size: 10px;
  text-align: center;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--orange);
  font-size: 9px;
  white-space: nowrap;
}

.status-tag::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-tag.ok {
  color: var(--accent);
}

.status-tag.error {
  color: var(--red);
}

.error-detail {
  display: block;
  max-width: 220px;
  margin-top: 3px;
  color: #d18d82;
  font-size: 9px;
  line-height: 1.4;
  white-space: normal;
}

.method-note {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 13px;
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(23, 29, 25, 0.7);
}

.method-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200, 243, 106, 0.38);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.method-note h2 {
  margin: 0 0 4px;
  font-size: 11px;
}

.method-note p {
  max-width: 850px;
  margin: 0;
  color: #929c91;
  font-size: 10px;
  line-height: 1.7;
}

.method-note p b {
  color: #d8e0d4;
  font-family: var(--mono);
  font-weight: 500;
}

.method-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 5px;
  padding-top: 2px;
}

.method-tags span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #899386;
  font-family: var(--mono);
  font-size: 8px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0 0;
  border-top: 1px solid var(--line-soft);
  color: #667166;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

@media (max-width: 950px) {
  .page-shell {
    padding-right: 28px;
    padding-left: 28px;
  }

  .workspace {
    grid-template-columns: minmax(275px, 0.8fr) minmax(0, 1.2fr);
    gap: 13px;
  }

  .controls-panel,
  .results-panel {
    padding: 17px;
  }

  .hero-orbit {
    right: -7px;
    opacity: 0.52;
  }

  .chart-row {
    grid-template-columns: minmax(70px, 0.8fr) minmax(45px, 1.5fr) 55px;
    gap: 7px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 0 17px 22px;
  }

  .topbar {
    min-height: 65px;
  }

  .wordmark {
    gap: 8px;
    font-size: 10px;
  }

  .local-badge {
    padding: 6px 8px;
    font-size: 8px;
  }

  .hero {
    min-height: 225px;
  }

  .hero-copy {
    padding: 35px 0;
  }

  h1 {
    max-width: 560px;
    font-size: clamp(30px, 8vw, 43px);
  }

  .hero-lede {
    max-width: 490px;
    padding-right: 22px;
    font-size: 12px;
  }

  .hero-orbit {
    right: -91px;
    opacity: 0.26;
  }

  .notice {
    align-items: start;
    margin-top: 16px;
  }

  .notice p {
    padding-top: 1px;
    font-size: 10px;
  }

  .state-pill {
    font-size: 8px;
  }

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

  .controls-panel,
  .results-panel {
    padding: 18px;
  }

  .results-panel {
    padding: 18px 14px;
  }

  .metric-card {
    min-height: 86px;
    padding: 10px;
  }

  .metric-card strong {
    font-size: clamp(18px, 6vw, 24px);
  }

  .method-note {
    grid-template-columns: 25px 1fr;
    gap: 9px;
    padding: 13px;
  }

  .method-tags {
    grid-column: 2;
    justify-content: start;
  }

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

  table {
    min-width: 540px;
  }

  footer {
    flex-direction: column;
    gap: 5px;
    font-size: 8px;
  }
}

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