.sql-card {
  border-top: 4px solid #111;
}

.sql-layout {
  display: grid;
  grid-template-columns: minmax(310px, .85fr) minmax(420px, 1.15fr);
  gap: 16px;
  padding: 20px clamp(24px, 7vw, 105px) 45px;
}

.sql-layout .panel {
  min-width: 0;
}

.sql-layout .audit-panel {
  grid-column: 1 / -1;
}

.danger-note {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #fff7e8;
  border-left: 4px solid #ef9b19;
  line-height: 1.45;
}

.danger-note span,
.sql-result p,
.audit-row small {
  color: #677378;
  font-size: 13px;
}

.sql-form {
  margin-top: 0;
}

.sql-form textarea {
  width: 100%;
  min-height: 225px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #cfd6d8;
  background: #f8f9f9;
  color: #111;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.sql-form textarea:focus {
  outline: 2px solid var(--cyan);
  border-color: transparent;
}

.confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.45;
}

.stack .confirm-row input {
  width: auto;
  margin: 3px 0 0;
  flex: 0 0 auto;
}

.result-panel h2,
.audit-panel h2 {
  margin-bottom: 12px;
}

.sql-result {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.sql-result.failed {
  border-left: 4px solid #c52f3b;
  padding-left: 14px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.result-head span {
  color: #677378;
  font-size: 12px;
}

.sql-result pre {
  max-height: 150px;
  overflow: auto;
  margin: 10px 0;
  padding: 10px;
  background: #f4f6f6;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.table-scroll {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-scroll th,
.table-scroll td {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.table-scroll th {
  position: sticky;
  top: 0;
  background: #edf2f3;
}

.audit-row {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.audit-status {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #c52f3b;
}

.audit-status.ok {
  background: #25a763;
}

.audit-row small,
.audit-row code {
  display: block;
  margin-top: 3px;
}

.audit-row code {
  overflow: hidden;
  color: #344146;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .sql-layout {
    grid-template-columns: 1fr;
  }

  .sql-layout .audit-panel {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .sql-layout {
    padding-left: 24px;
    padding-right: 24px;
  }

  .sql-form textarea {
    min-height: 190px;
  }
}
