.prompt-group { margin: 28px 0 36px; }
.prompt-group-title {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-size: 1.35rem;
}
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.prompt-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease;
}
.prompt-card:hover { box-shadow: var(--shadow-card-hover); }
.prompt-card p { margin: 0; }
.prompt-card-category {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-tint);
  color: var(--primary-h);
  font-size: 0.75rem;
  font-weight: 600;
}
.vi-page-body .prompt-card .prompt-card-title,
.prompt-card .prompt-card-title {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}
.prompt-card-summary { color: var(--text); font-size: 0.92rem; line-height: 1.5; }
.prompt-card-note { color: var(--muted); font-size: 0.82rem; }
.page-content a.prompt-open,
a.prompt-open {
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.page-content a.prompt-open:hover,
a.prompt-open:hover { background: var(--primary-h); text-decoration: none; }

.prompt-details {
  margin: 0 0 28px;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.prompt-details-title {
  margin: 6px 0 8px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.25;
}
.prompt-details-title:focus { outline: none; }
.prompt-details-title:focus-visible { box-shadow: var(--focus-ring); border-radius: 4px; }
.prompt-details-summary { margin: 0 0 18px; line-height: 1.55; }
.prompt-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.prompt-metadata div {
  padding: 6px 11px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface-alt);
}
.prompt-metadata dt {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.prompt-metadata dd { margin: 1px 0 0; font-size: 0.83rem; font-weight: 600; }
.prompt-quick-section h4 { margin: 0 0 6px; color: var(--ink); font-size: 1.05rem; }
.prompt-quick-section > p { margin: 0 0 10px; color: var(--muted); font-size: 0.9rem; }
.prompt-copyable { position: relative; }
.prompt-details pre.prompt-code {
  max-height: 300px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface-alt);
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.prompt-details pre.prompt-code code {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  white-space: inherit;
}
.prompt-copy {
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.prompt-copy[hidden] { display: none; }
.prompt-copy:hover { background: var(--primary-tint); }
.prompt-copy.is-copied { border-color: var(--tone-green-fg); background: var(--tone-green-bg); color: var(--tone-green-fg); }
.prompt-details-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.page-content a.prompt-full-link,
a.prompt-full-link {
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.page-content a.prompt-full-link:hover,
a.prompt-full-link:hover { background: var(--primary-h); text-decoration: none; }

.prompt-dialog-open { overflow: hidden; }
.prompt-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(14, 23, 38, 0.28);
  overflow: auto;
  overscroll-behavior: contain;
}
.prompt-dialog::backdrop { background: rgba(14, 23, 38, 0.5); }
.prompt-dialog-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 12px 12px 0;
  background: linear-gradient(var(--surface) 70%, rgba(255, 255, 255, 0));
}
.prompt-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.prompt-dialog-close:hover { background: var(--surface-alt); }
.prompt-dialog .prompt-details { margin: 0; padding: 0 32px 32px; border: 0; border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  .prompt-card { transition: none; }
}
@media (max-width: 640px) {
  .prompt-details { padding: 18px; }
  .prompt-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .prompt-dialog .prompt-details { padding: 0 18px 24px; }
}
