.demo-shell {
  width: min(1680px, 100%);
}

.demo-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 42px 0 26px;
}

.demo-hero h1 {
  max-width: 720px;
  margin-top: 16px;
  color: #fff;
  font-size: clamp(2.15rem, 4.5vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.demo-hero p:not(.eyebrow) {
  max-width: 650px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.72;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 290px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 13, 28, 0.72);
  padding: 13px 15px;
}

.connection-card > div {
  display: grid;
  gap: 2px;
}

.connection-card b {
  color: #edf4ff;
  font-size: 0.8rem;
}

.connection-card span:last-child {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.67rem;
}

.connection-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.1);
}

.connection-card.ready .connection-dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.connection-card.error .connection-dot {
  background: var(--rose);
  box-shadow: 0 0 0 5px rgba(255, 111, 145, 0.12);
}

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

.stat-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
  padding: 15px 17px;
}

.stat-card span {
  color: var(--soft);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong {
  color: #fff;
  font-size: 1.55rem;
  line-height: 1.15;
}

.stat-card small {
  color: var(--soft);
  font-size: 0.68rem;
}

.accent-stat {
  border-color: rgba(22, 214, 167, 0.28);
  background: linear-gradient(135deg, rgba(22, 214, 167, 0.13), rgba(15, 23, 42, 0.58));
}

.workspace {
  display: grid;
  grid-template-columns: 220px minmax(480px, 1.4fr) minmax(310px, 0.74fr);
  gap: 14px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.67);
}

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

.panel-heading h2 {
  margin-top: 2px;
  color: #fff;
  font-size: 0.96rem;
}

.kicker {
  color: var(--soft);
  font-size: 0.61rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.schema-panel {
  position: sticky;
  top: 16px;
  padding: 16px;
}

.icon-button,
.text-button,
.response-meta button {
  border: 0;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
}

.icon-button {
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
}

.icon-button:hover,
.text-button:hover,
.response-meta button:hover {
  color: #fff;
}

.table-list {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.table-button {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 9px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.table-button:hover {
  background: rgba(148, 163, 184, 0.07);
}

.table-button.active {
  border-color: rgba(22, 214, 167, 0.3);
  background: var(--accent-soft);
  color: #fff;
}

.table-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 20, 0.55);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
}

.table-button > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.table-button b {
  font-family: var(--mono);
  font-size: 0.75rem;
}

.table-button small {
  overflow: hidden;
  color: var(--soft);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-button em {
  color: var(--soft);
  font-size: 0.65rem;
  font-style: normal;
}

.schema-relations {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.schema-relations div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
}

.schema-relations div code:last-child {
  grid-column: 1;
}

.schema-relations div span {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--soft);
  font-size: 0.7rem;
}

.schema-relations code {
  color: #b7c5d8;
  font-family: var(--mono);
  font-size: 0.61rem;
}

.reset-button {
  width: 100%;
  margin-top: 20px;
  padding-inline: 10px;
  font-size: 0.7rem;
}

.workbench,
.result-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.result-column {
  position: sticky;
  top: 16px;
}

.editor-panel {
  overflow: hidden;
}

.editor-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 9px 12px 0;
}

.editor-tab {
  position: relative;
  border: 0;
  background: transparent;
  padding: 10px 13px 12px;
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
}

.editor-tab::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  content: "";
}

.editor-tab.active {
  color: #fff;
}

.editor-tab.active::after {
  background: var(--accent);
}

.shortcut {
  margin-left: auto;
  color: #58677d;
  font-family: var(--mono);
  font-size: 0.59rem;
}

.editor-view {
  display: none;
  padding: 16px;
}

.editor-view.active {
  display: block;
}

.request-line {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 8px;
}

.method-select,
.path-input,
.editor-field textarea,
.sql-field textarea,
.params-field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 9, 20, 0.78);
  color: #dbe7f5;
  outline: none;
}

.method-select:focus,
.path-input:focus,
.editor-field textarea:focus,
.sql-field textarea:focus,
.params-field input:focus {
  border-color: rgba(22, 214, 167, 0.58);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.method-select {
  padding: 0 11px;
  color: #7ee8ca;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 800;
}

.path-input {
  min-width: 0;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.run-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  padding: 0 14px;
  color: #03120f;
  font-size: 0.73rem;
  font-weight: 800;
  cursor: pointer;
}

.run-button:hover {
  background: #35e4b8;
}

.run-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.run-button span {
  color: rgba(3, 18, 15, 0.55);
  font-family: var(--mono);
  font-size: 0.61rem;
}

.preset-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  margin-top: 14px;
  padding-bottom: 2px;
}

.preset-row > span {
  margin-right: 2px;
  color: var(--soft);
  font-size: 0.65rem;
  font-weight: 700;
}

.preset {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 9, 20, 0.55);
  padding: 5px 9px;
  color: #aebdd0;
  font-size: 0.65rem;
  cursor: pointer;
}

.preset:hover {
  border-color: var(--line-strong);
  color: #fff;
}

.editor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.editor-field,
.sql-field,
.params-field {
  display: grid;
  gap: 6px;
}

.editor-field label,
.sql-field label,
.params-field label {
  color: #aebdd0;
  font-size: 0.68rem;
  font-weight: 720;
}

.editor-field label span {
  margin-left: 5px;
  color: #59687e;
  font-weight: 500;
}

.editor-field textarea {
  min-height: 112px;
  resize: vertical;
  padding: 10px 11px;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.55;
}

.sql-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.language-pill {
  align-self: center;
  border: 1px solid rgba(240, 166, 255, 0.25);
  border-radius: 6px;
  background: rgba(240, 166, 255, 0.08);
  padding: 3px 7px;
  color: #f0a6ff;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 800;
}

.sql-field {
  margin-top: 14px;
}

.sql-field textarea {
  min-height: 190px;
  resize: vertical;
  padding: 14px;
  color: #d9e2f1;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.65;
  tab-size: 2;
}

.params-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin-top: 11px;
}

.params-field input {
  min-width: 0;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
}

.params-field small {
  grid-column: 2;
  color: var(--soft);
  font-size: 0.61rem;
}

.data-panel,
.response-panel,
.history-panel {
  padding: 16px;
}

.count-badge,
.response-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.61rem;
  font-weight: 800;
}

.response-badge.ok {
  border-color: rgba(22, 214, 167, 0.35);
  background: var(--accent-soft);
  color: #9fffe6;
}

.response-badge.error {
  border-color: rgba(255, 111, 145, 0.35);
  background: rgba(255, 111, 145, 0.08);
  color: #ffabc0;
}

.table-wrap {
  overflow: auto;
  max-height: 370px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 9px 11px;
  text-align: left;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0b1120;
  color: #7f8fa6;
  font-size: 0.61rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table td {
  max-width: 230px;
  overflow: hidden;
  color: #cbd6e6;
  text-overflow: ellipsis;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.05);
}

.null-value {
  color: #687890;
  font-style: italic;
}

.response-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.response-meta button,
.text-button {
  font-size: 0.65rem;
}

.response-output {
  overflow: auto;
  min-height: 270px;
  max-height: 460px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #070b17;
  padding: 13px;
  color: #cdd8e8;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.request-log {
  display: grid;
  gap: 7px;
  overflow-y: auto;
  max-height: 240px;
  margin-top: 13px;
}

.empty-log {
  color: var(--soft);
  font-size: 0.72rem;
}

.log-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.11);
  padding: 0 0 7px;
  font-family: var(--mono);
  font-size: 0.61rem;
}

.log-method {
  color: var(--accent);
  font-weight: 800;
}

.log-path {
  overflow: hidden;
  color: #adbbcf;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-time {
  color: #65758c;
}

.log-entry.error .log-method {
  color: var(--rose);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .result-column {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: 1.35fr 0.65fr;
  }
}

@media (max-width: 850px) {
  .demo-hero {
    align-items: start;
    flex-direction: column;
  }

  .connection-card {
    width: 100%;
  }

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

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

  .schema-panel,
  .result-column {
    position: static;
  }

  .schema-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .schema-panel .panel-heading,
  .schema-panel .table-list {
    grid-column: 1 / -1;
  }

  .table-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .schema-relations {
    margin-top: 0;
  }

  .reset-button {
    align-self: end;
    margin-top: 0;
  }

  .result-column {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .demo-hero {
    padding-top: 32px;
  }

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

  .stat-card {
    padding: 13px;
  }

  .schema-panel {
    display: block;
  }

  .table-list {
    grid-template-columns: 1fr;
  }

  .schema-relations,
  .reset-button {
    margin-top: 16px;
  }

  .request-line {
    grid-template-columns: 92px 1fr;
  }

  .run-button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .editor-fields {
    grid-template-columns: 1fr;
  }

  .shortcut {
    display: none;
  }

  .params-field {
    grid-template-columns: 1fr;
  }

  .params-field small {
    grid-column: 1;
  }
}
