/* Prompt Builder — composer UI (shell from tool-ui.css) */

.builder-shell {
  position: relative;
  margin-bottom: 24px;
}

.builder-card .tool-card-head {
  flex-wrap: wrap;
  gap: 10px;
}

.builder-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.builder-labels-toggle span {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 0.74rem;
}

/* Output textarea — override tool-card-body defaults */
.builder-card .tool-card-body {
  padding: 0;
}

.builder-card .tool-card-body .builder-output {
  min-height: 160px;
  resize: vertical;
}

.tool-help ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.65;
}

.tool-help li {
  margin: 6px 0;
}

.tool-help li strong {
  color: var(--text-main);
}

/* Output textarea */
.builder-output {
  display: block;
  width: 100%;
  min-height: 160px;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

.builder-output.is-empty {
  color: var(--text-dim);
  font-style: italic;
  font-family: var(--font);
}

.builder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pillar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.pillar-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.18);
}

.pillar-btn.is-active {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.26);
  color: var(--text-main);
}

.pillar-btn.is-open {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.40);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

.pillar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  display: none;
}

.pillar-btn.is-active .pillar-dot {
  display: block;
}

.pillar-btn svg {
  width: 13px;
  height: 13px;
  opacity: 0.55;
  flex-shrink: 0;
}

.pillar-btn.is-active svg,
.pillar-btn.is-open svg {
  opacity: 0.9;
}

/* Popover */
.pillar-popover {
  position: fixed;
  z-index: 200;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: rgba(20, 20, 28, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  padding: 16px 16px 14px;
  display: none;
  flex-direction: column;
  gap: 11px;
}

.pillar-popover.is-open {
  display: flex;
}

.pillar-popover::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(20, 20, 28, 0.97);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.pop-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
}

.pop-hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.pop-input {
  width: 100%;
  padding: 10px 13px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-main);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.84rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pop-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.pop-input::placeholder {
  color: var(--text-dim);
}

.pop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pop-guide {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 2px 0 0;
}

.pop-guide a {
  color: var(--link);
  text-decoration: none;
}

.pop-guide a:hover {
  text-decoration: underline;
}

.builder-example {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.builder-example > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text-main);
  font-size: 0.82rem;
}

.builder-example pre {
  margin: 0;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre-wrap;
}

.builder-ext-note {
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.builder-ext-note a {
  color: var(--link);
}

@media (max-width: 620px) {
  .builder-head-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}
