.store-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}

.store-card .store-actions button {
  width: 100%;
  margin-top: 0;
}

.agent-settings-dialog {
  width: min(920px, calc(100% - 30px));
  max-height: 92vh;
}

.agent-settings-body {
  padding: 28px;
}

.agent-model {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px 14px;
  align-items: center;
  padding: 13px 15px;
  margin-bottom: 18px;
  border-radius: 11px;
  background: #f4f7f4;
  font-size: 12px;
}

.agent-model span {
  color: var(--sub);
  font-weight: 700;
}

.voice-picker { margin:0 0 20px; padding:17px; border:1px solid #cfe2d2; border-radius:13px; background:#fbfdfb; }
.voice-picker-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.voice-picker h4 { margin:0; font-size:17px; }
.voice-picker p { margin:5px 0 0; color:var(--sub); font-size:12px; }
.voice-controls { display:grid; grid-template-columns:minmax(220px,1fr) auto; gap:12px; align-items:end; margin-top:14px; }
.voice-buttons { display:flex; gap:8px; }
.voice-buttons button { white-space:nowrap; }
.voice-description { min-height:18px; }
.voice-picker audio { width:100%; margin-top:12px; }
.voice-playback-message { min-height:18px; margin-top:8px!important; color:#366449!important; font-weight:700; }
.voice-picker > small { display:block; margin-top:10px; color:var(--sub); line-height:1.5; }
.voice-picker .release-badge.pending { background:#9a6719; }
.fixed-audio-controls { display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; margin-top:13px; padding:11px 12px; border-radius:9px; background:#f0f6f1; }
.fixed-audio-controls label { display:flex; flex-direction:row; align-items:center; gap:7px; font-size:13px; font-weight:750; }
.fixed-audio-controls input { width:auto; margin:0; }
.fixed-audio-controls span { margin-left:auto; color:var(--sub); font-size:12px; }
.fixed-audio-controls.unsupported { opacity:.62; }

.agent-release {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 13px 15px;
  margin-bottom: 12px;
  border: 1px solid #cfe2d2;
  border-radius: 11px;
  background: #f3faf4;
}

.agent-release div { display: flex; align-items: center; gap: 10px; }
.agent-release p { margin: 0; color: var(--sub); font-size: 12px; }
.release-badge { padding: 5px 9px; border-radius: 999px; background: #1d5630; color: white; font-size: 11px; }

.validation-panel,
.version-panel,
.prompt-test {
  margin-top: 22px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafcfb;
}

.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.section-title h4 { margin: 0; font-size: 16px; }
.section-title p, .prompt-test p { margin: 5px 0 0; color: var(--sub); font-size: 12px; }
.section-title > span { font-size: 12px; font-weight: 800; }
.all-passed { color: #24743b; }
.has-failed { color: #a6382f; }
.validation-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.validation-item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 9px; font-size: 12px; }
.validation-item.passed { background: #edf8ef; color: #256c38; }
.validation-item.failed { background: #fff0ee; color: #9b332b; }
.validation-item span { color: var(--sub); }

.prompt-test summary { cursor: pointer; font-weight: 800; }
.test-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 12px; }
.test-row button { white-space: nowrap; }
.test-answer { margin: 12px 0 0; padding: 14px; border-radius: 9px; background: #16231a; color: #eef8f0; white-space: pre-wrap; line-height: 1.6; font-family: inherit; font-size: 13px; }

.version-list { display: grid; gap: 8px; margin-top: 13px; max-height: 260px; overflow: auto; }
.version-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; background: white; border: 1px solid var(--line); }
.version-item div { display: grid; gap: 3px; }
.version-item span, .version-item small { color: var(--sub); font-size: 12px; }
.version-item button { white-space: nowrap; }
.publish-note { margin-top: 18px; }

.prompt-field textarea,
.knowledge-content {
  line-height: 1.6;
  resize: vertical;
}

.prompt-field small {
  text-align: right;
}

.knowledge-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding-top: 24px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.knowledge-head h4 {
  margin: 0;
  font-size: 18px;
}

.knowledge-head p {
  margin: 5px 0 0;
  color: var(--sub);
  font-size: 12px;
}

.knowledge-editor {
  display: grid;
  gap: 12px;
  max-height: 42vh;
  overflow: auto;
  padding: 14px 3px 3px;
}

.knowledge-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafcfb;
}

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

.knowledge-item-head strong {
  color: var(--sub);
  font-size: 12px;
}

.knowledge-item-head .danger {
  padding: 6px 10px;
  white-space: nowrap;
}

.knowledge-row {
  display: grid;
  grid-template-columns: minmax(120px, .75fr) minmax(180px, 1.5fr) 120px;
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 700px) {
  .agent-settings-body {
    padding: 20px 16px;
  }
  .agent-model,
  .knowledge-row,
  .validation-list,
  .test-row {
    grid-template-columns: 1fr;
  }
  .agent-release, .version-item { align-items: flex-start; flex-direction: column; }
  .voice-picker-head { align-items:flex-start; }
  .voice-controls { grid-template-columns:1fr; }
  .voice-buttons { display:grid; grid-template-columns:1fr 1fr; }
  .store-actions {
    grid-template-columns: 1fr;
  }
}
