/* Prompt Library. Uses the Sift tokens, type, and controls from styles.css. */

.nav-links .is-active {
  color: var(--accent-ink);
}

.pl-hero {
  padding: 72px 0 28px;
}

.pl-hero h1 {
  max-width: 16em;
  font-size: clamp(2.35rem, 4.6vw, 3.7rem);
  line-height: 1.05;
}

.pl-hero h1 em {
  display: block;
  color: var(--accent-ink);
  font-style: normal;
}

.pl-hero .hero-subhead {
  max-width: 640px;
}

.pl-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.pl-jumps a {
  transition: color 160ms ease;
}

.pl-jumps a:hover {
  color: var(--text-primary);
}

.pl-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.pl-meta div {
  border-top: 1px solid var(--border-hairline);
  padding-top: 16px;
}

.pl-meta b {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.pl-meta span {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pl-var,
.pl-card pre .v,
.pl-panel pre .v {
  color: var(--accent-ink);
  background: rgba(255, 107, 53, 0.12);
  border-radius: 4px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.pl-var {
  white-space: nowrap;
}

.pl-how {
  padding: 20px 0 72px;
}

.pl-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pl-step {
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--surface-raised);
  padding: 24px;
}

.pl-step .n {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.pl-step h3 {
  margin-top: 28px;
  font-size: 1.35rem;
}

.pl-step p {
  margin: 12px 0 0;
  color: var(--text-dim);
}

.pl-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 30;
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  backdrop-filter: blur(16px);
}

.pl-bar .container {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.pl-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pl-tabs::-webkit-scrollbar {
  display: none;
}

.pl-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font: 700 0.82rem var(--font-mono);
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.pl-tab small {
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.pl-tab:hover,
.pl-tab.is-on {
  border-color: rgba(255, 107, 53, 0.48);
  background: rgba(255, 107, 53, 0.08);
  color: var(--accent-ink);
}

.pl-tab.is-on small,
.pl-tab:hover small {
  color: var(--accent-ink);
}

.pl-search {
  position: relative;
  flex: 0 0 280px;
}

.pl-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.pl-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  padding: 0 14px 0 40px;
  outline: none;
}

.pl-search input:focus {
  border-color: rgba(255, 107, 53, 0.7);
  outline: 2px solid var(--accent-signal);
  outline-offset: 3px;
}

.pl-group {
  padding: 64px 0 8px;
}

.pl-ghead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 28px;
}

.pl-ghead .k {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pl-ghead h2 {
  max-width: 12em;
  font-size: clamp(2rem, 4vw, 3.05rem);
  line-height: 1.05;
}

.pl-ghead p {
  margin: 0;
  max-width: 460px;
  justify-self: end;
  color: var(--text-dim);
}

.pl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pl-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--surface-raised);
  padding: 24px;
  opacity: 0;
  animation: pl-in 0.5s ease forwards;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.pl-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 53, 0.38);
  box-shadow: 0 18px 42px rgba(10, 10, 10, 0.08);
}

@keyframes pl-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pl-chead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.pl-num {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.pl-card h3 {
  margin-top: 8px;
  font-size: 1.45rem;
  line-height: 1.15;
}

.pl-does {
  min-height: 48px;
  margin: 12px 0 18px;
  color: var(--text-dim);
}

.pl-copy {
  width: auto;
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.pl-copy.is-copied {
  border-color: var(--accent-signal);
  background: var(--accent-signal);
  color: #0A0A0A;
}

.pl-card pre {
  flex: 1;
  margin: 0;
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text-dim);
  padding: 18px 20px;
  font: 500 0.82rem/1.7 var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.pl-card pre .lab {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pl-empty {
  display: none;
  margin: 0;
  padding: 72px 0;
  color: var(--text-muted);
  text-align: center;
}

.pl-tips {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 40px;
  align-items: start;
  border-top: 1px solid var(--border-hairline);
  margin-top: 56px;
  padding: 88px 0 28px;
}

.pl-tips h2 {
  max-width: 11em;
  font-size: clamp(2rem, 4vw, 3.05rem);
  line-height: 1.05;
}

.pl-tips ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pl-tips li {
  border-top: 1px solid var(--border-hairline);
  padding-top: 16px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.pl-tips li b {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-weight: 600;
}

.pl-credit {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0 56px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.pl-credit b {
  color: var(--text-primary);
  font-weight: 600;
}

.pl-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(22, 163, 74, 0.45);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-deep);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.pl-toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
}

.pl-toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .pl-hero {
    padding-top: 48px;
  }

  .pl-meta,
  .pl-steps,
  .pl-ghead,
  .pl-grid,
  .pl-tips,
  .pl-tips ul {
    grid-template-columns: 1fr;
  }

  .pl-ghead p {
    justify-self: start;
  }

  .pl-does {
    min-height: 0;
  }

  .pl-bar .container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pl-search {
    flex: none;
  }

  .pl-how {
    padding-bottom: 48px;
  }

  .pl-group {
    padding-top: 48px;
  }

  .pl-tips {
    gap: 22px;
    margin-top: 36px;
    padding-top: 56px;
  }
}

@media (max-width: 560px) {
  .pl-hero {
    padding-top: 36px;
  }

  .pl-step,
  .pl-card {
    padding: 20px;
  }

  .pl-card h3 {
    font-size: 1.28rem;
  }

  .pl-card pre {
    padding: 14px 16px;
    font-size: 0.75rem;
  }

  .pl-copy {
    min-height: 34px;
    padding: 0 10px;
  }

  .pl-toast {
    bottom: 96px;
    max-width: calc(100% - 32px);
  }

  .pl-credit {
    flex-direction: column;
    padding-bottom: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pl-card {
    opacity: 1;
    animation: none;
  }
}

.pl-acc {
  padding: 28px 0 12px;
}

.pl-acc-heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.pl-item {
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--surface-raised);
  scroll-margin-top: calc(var(--header-height) + 88px);
}

.pl-item + .pl-item {
  margin-top: 10px;
}

.pl-item.is-open {
  border-color: rgba(255, 107, 53, 0.48);
}

.pl-acc-btn {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pl-acc-btn .pl-num {
  color: var(--accent-ink);
  font-size: 0.82rem;
}

.pl-acc-title {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}

.pl-acc-does {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
}

.pl-chevron {
  color: var(--text-muted);
  transition: transform 160ms ease;
}

.pl-item.is-open .pl-chevron {
  color: var(--accent-ink);
  transform: rotate(180deg);
}

.pl-panel {
  padding: 0 20px 20px;
}

.pl-panel-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.pl-panel pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text-dim);
  padding: 18px 20px;
  font: 500 0.82rem/1.7 var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.pl-panel pre .lab {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.04em;
}

@media (max-width: 560px) {
  .pl-acc-btn {
    gap: 12px;
    align-items: start;
    padding: 16px;
  }

  .pl-acc-title {
    font-size: 1.05rem;
  }

  .pl-acc-does {
    font-size: 0.88rem;
  }

  .pl-panel {
    padding: 0 16px 16px;
  }

  .pl-panel-top {
    justify-content: stretch;
  }

  .pl-panel .pl-copy {
    width: 100%;
  }

  .pl-panel pre {
    padding: 14px 16px;
    font-size: 0.75rem;
  }
}
