/* assets/persona-dashboard.css
 * Interactive persona dashboard: instant-launch tool cards, inline workflow
 * runner, and live checklist progress. Direct-linked from persona pages
 * (not bundled), same as ddt-tool-page.css. All behaviour is client-side.
 */

.pd-dash {
  --pd-accent: var(--rd-accent-cyan, #00d4ff);
  margin: 8px 0 28px;
}

.pd-intro {
  color: var(--text-muted);
  max-width: 760px;
  margin: 4px 0 20px;
}

.pd-sec {
  margin-top: 30px;
}

.pd-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.pd-sec-head h2 {
  margin: 0;
  font-size: 1.12rem;
}

.pd-sec-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ----- Instant-launch tool grid ------------------------------------ */

.pd-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pd-tool-item {
  min-width: 0;
  list-style: none;
}

.pd-tool {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 14px 46px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text-main);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pd-tool:hover,
.pd-tool:focus-visible {
  border-color: var(--pd-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px -10px var(--pd-accent);
  outline: none;
}

.pd-tool:focus-visible {
  outline: 2px solid var(--pd-accent);
  outline-offset: 2px;
}

.pd-tool-name {
  font-weight: 650;
  font-size: 0.96rem;
}

.pd-tool-desc {
  color: var(--text-muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

.pd-key {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  border-bottom-width: 2px;
  background: var(--bg-subtle, var(--bg-elevated));
  color: var(--text-muted);
  font: 600 0.74rem/1 var(--font-mono, ui-monospace, monospace);
}

.pd-tool:hover .pd-key,
.pd-tool:focus-visible .pd-key {
  color: var(--pd-accent);
  border-color: var(--pd-accent);
}

/* ----- Inline workflow runner -------------------------------------- */

.pd-workflows {
  display: grid;
  gap: 16px;
}

.pd-wf {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg-elevated);
  padding: 16px;
}

.pd-wf-head {
  margin-bottom: 10px;
}

.pd-wf-title {
  margin: 0 0 2px;
  font-size: 1rem;
}

.pd-wf-desc {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.pd-wf-steps {
  display: inline-block;
  font: 600 0.74rem/1.4 var(--font-mono, ui-monospace, monospace);
  color: var(--pd-accent);
  word-break: break-word;
}

.pd-wf-inputlabel {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pd-wf-input {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--bg-subtle, var(--bg-base, #0d1117));
  color: var(--text-main);
  font: 0.85rem/1.45 var(--font-mono, ui-monospace, monospace);
}

.pd-wf-input:focus-visible {
  outline: 2px solid var(--pd-accent);
  outline-offset: -1px;
  border-color: var(--pd-accent);
}

.pd-wf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.pd-wf-run {
  border: 1px solid var(--pd-accent);
  background: var(--pd-accent);
  color: #05070d;
  font-weight: 650;
  border-radius: 9px;
  padding: 8px 16px;
  cursor: pointer;
}

.pd-wf-run:hover { filter: brightness(1.08); }
.pd-wf-run:disabled { opacity: 0.55; cursor: not-allowed; }

.pd-wf-sample {
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-main);
  border-radius: 9px;
  padding: 8px 14px;
  cursor: pointer;
}

.pd-wf-sample:hover { border-color: var(--pd-accent); }

.pd-wf-open {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pd-accent);
  text-decoration: none;
}

.pd-wf-open:hover { text-decoration: underline; }

.pd-wf-status {
  margin: 10px 0 0;
  min-height: 1.1em;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pd-wf-status[data-tone="success"] { color: var(--success, #10b981); }
.pd-wf-status[data-tone="error"] { color: var(--danger, #ef4444); }

.pd-wf-pipeline {
  margin-top: 12px;
}

.pd-wf-pipeline:empty { display: none; }

/* ----- Checklists --------------------------------------------------- */

.pd-checklists {
  display: grid;
  gap: 16px;
}

.pd-checklist-card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.pd-checklist-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.pd-checklist-topbar h3 {
  margin: 0;
  font-size: 0.98rem;
}

.pd-checklist-topbar h3 a {
  color: var(--text-main);
  text-decoration: none;
}

.pd-checklist-topbar h3 a:hover { text-decoration: underline; }

.pd-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pd-progress-count {
  font: 600 0.78rem/1 var(--font-mono, ui-monospace, monospace);
  color: var(--text-muted);
}

.pd-progress-bar {
  width: 88px;
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.pd-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--pd-accent);
  transition: width 0.3s ease;
}

.pd-checklist-card .ddt-checklist {
  padding: 4px 12px 12px;
}

/* ----- Collapsed SEO accordion ------------------------------------- */

.pd-guide {
  margin-top: 26px;
}

.pd-guide .topic-problems { columns: 2; column-gap: 28px; max-width: 760px; }
.pd-guide .topic-problems li { margin-bottom: 6px; }
.pd-guide .topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 8px 0 4px;
}
.pd-guide .topic-card {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pd-guide .topic-card h3 { margin: 0; font-size: 1rem; }
.pd-guide .topic-card h3 a { text-decoration: none; color: var(--text-main); }
.pd-guide .topic-card h3 a:hover { text-decoration: underline; }
.pd-guide .topic-card p { margin: 0; color: var(--text-muted); font-size: 0.88rem; flex: 1; }
.pd-guide .topic-card-go { align-self: flex-start; font-size: 0.8rem; color: var(--pd-accent); text-decoration: none; font-weight: 600; }
.pd-guide .topic-card-go:hover { text-decoration: underline; }
.pd-guide .topic-section { margin-top: 24px; }
.pd-guide .topic-intro { color: var(--text-muted); max-width: 760px; }
.pd-guide .topic-faq-item { border-top: 1px solid var(--border-soft); padding: 12px 0; }
.pd-guide .topic-faq-item h3 { margin: 0 0 4px; font-size: 0.98rem; }
.pd-guide .topic-faq-item p { margin: 0; color: var(--text-muted); }

@media (max-width: 560px) {
  .pd-guide .topic-problems { columns: 1; }
  .pd-wf-open { margin-left: 0; }
}

/* Phase 6: capability line on persona workflow cards. Manual steps are a
   supported execution mode, so this is informational, not a warning. */
.pd-wf-capability {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
