
/* Prompt preset modal */
.prompt-preset-tool {
  font-weight: 800;
  color: #4f46e5;
  background: linear-gradient(180deg, #eef2ff 0%, #f5f3ff 100%);
  border-color: rgba(99,102,241,.18);
}

.prompt-preset-modal {
  align-items: center;
  justify-content: center;
}

.prompt-preset-card {
  width: min(1080px, 96vw);
  max-height: 88vh;
  background: #fff;
  border-radius: 26px;
  border: 1px solid rgba(99,102,241,.14);
  box-shadow: 0 34px 90px -28px rgba(15,23,42,.36);
  padding: 22px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
}

.prompt-preset-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.prompt-preset-head h3 { margin: 0; font-size: 22px; }
.prompt-preset-head p { margin: 6px 0 0; color: var(--muted); max-width: 720px; }

.prompt-preset-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.prompt-preset-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

.prompt-preset-categories {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
  padding-right: 4px;
}

.prompt-preset-category {
  width: 100%;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-radius: 16px;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  color: #374151;
  gap: 8px;
}
.prompt-preset-category span { font-weight: 700; }
.prompt-preset-category em {
  font-style: normal;
  font-size: 11px;
  color: #6b7280;
  padding: 2px 7px;
  background: #f3f4f6;
  border-radius: 999px;
}
.prompt-preset-category.active {
  border-color: rgba(99,102,241,.32);
  color: #4f46e5;
  background: linear-gradient(180deg, #eef2ff 0%, #f5f3ff 100%);
}

.prompt-preset-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding-right: 4px;
  align-content: start;
}

.prompt-preset-item {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
  display: grid;
  gap: 10px;
  box-shadow: 0 14px 28px -24px rgba(15,23,42,.22);
}
.prompt-preset-item-head {
  display: flex;
  gap: 8px;
  align-items: center;
}
.prompt-preset-item-head strong { line-height: 1.25; }
.prompt-preset-item p {
  margin: 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.prompt-preset-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
}
.prompt-preset-badge.chat {
  background: #ecfdf5;
  color: #059669;
}
.prompt-preset-use {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
}
.prompt-preset-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 48px 12px;
}

/* Role prompt selector */
.role-prompt-control {
  min-width: min(320px, 100%);
}
.role-prompt-trigger {
  width: 100%;
  min-height: 42px;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.role-prompt-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-prompt-trigger em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 12px;
  color: #4f46e5;
  font-weight: 800;
}

/* Role Prompt modal: full-screen workspace */
.role-prompt-modal {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.role-prompt-card {
  width: 100vw;
  height: 100vh;
  max-height: none;
  border-radius: 0;
  padding: 22px;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.role-prompt-card .prompt-preset-head {
  align-items: center;
}
.role-prompt-card .prompt-preset-head p {
  max-width: none;
}
.role-prompt-card .prompt-preset-body {
  grid-template-columns: 7.5em minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}
.role-prompt-card .prompt-preset-categories {
  width: 7.5em;
  gap: 8px;
  padding-right: 0;
}
.role-prompt-card .prompt-preset-category {
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 8px;
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.role-prompt-card .prompt-preset-category span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.role-prompt-card .prompt-preset-category em {
  min-width: 28px;
  text-align: center;
  padding: 2px 6px;
}
.role-prompt-card .prompt-preset-list {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  grid-auto-rows: minmax(260px, auto);
  gap: 14px;
}
.role-prompt-card .prompt-preset-item {
  min-height: 260px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.role-prompt-item p {
  max-height: none;
  overflow: auto;
  font-size: 13px;
  line-height: 1.72;
}
.role-prompt-card .prompt-preset-use {
  height: 42px;
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
}

@media (max-width: 760px) {
  .role-prompt-card {
    padding: 14px;
  }
  .role-prompt-card .prompt-preset-body {
    grid-template-columns: 1fr;
  }
  .role-prompt-card .prompt-preset-categories {
    width: 100%;
    grid-auto-flow: column;
    grid-auto-columns: 7.5em;
    overflow-x: auto;
  }
  .role-prompt-card .prompt-preset-category {
    width: 7.5em;
  }
  .role-prompt-card .prompt-preset-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .prompt-preset-card { padding: 16px; max-height: 92vh; }
  .prompt-preset-body { grid-template-columns: 1fr; }
  .prompt-preset-categories { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .prompt-preset-category { width: max-content; }
  .prompt-preset-controls { grid-template-columns: 1fr; }
}
