.plan-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-surface);
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  flex-shrink: 0;
}

.detail-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.detail-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.detail-close:hover {
  color: var(--text-primary);
}

.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.detail-section {
  margin-bottom: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 12px 20px;
  margin-bottom: 4px;
}

.detail-cell {
  min-width: 0;
}

.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.detail-value a {
  color: var(--accent-blue);
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

.detail-value code {
  background: var(--bg-raised);
  padding: 0 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.detail-muted {
  color: var(--text-muted);
  font-style: italic;
}

.detail-badge {
  display: inline-block;
  font-size: 10px;
  padding: 0 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.detail-badge.local {
  background: rgba(78, 201, 176, 0.12);
  color: #4ec9b0;
}

.detail-badge.remote {
  background: rgba(220, 220, 170, 0.12);
  color: #dcdcaa;
}

.pr-state-open {
  background: rgba(78, 201, 176, 0.12);
  color: #4ec9b0;
}

.pr-state-closed {
  background: rgba(244, 71, 71, 0.12);
  color: #f44747;
}

.pr-state-merged {
  background: rgba(136, 87, 203, 0.12);
  color: #c586c0;
}

/* Links */
.detail-links {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-link-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.detail-link-btn {
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: var(--bg-raised);
  color: var(--accent-blue);
  font-size: 12px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.detail-link-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-blue);
}

/* Commands & Actions grid */
.detail-commands-actions {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-copy-section {
}

.detail-copy-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.detail-code-snippet {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  background: var(--bg-deepest);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.detail-code-snippet code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  background: none;
  padding: 0;
  word-break: break-all;
  white-space: pre-wrap;
}

.detail-code-snippet:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent-blue);
}

.detail-toast {
  margin-top: 8px;
  font-size: 11px;
  color: var(--accent-green);
}

/* Server Actions */
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-item {
  display: flex;
  flex-direction: column;
}

.detail-action-btn {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(120, 90, 200, 0.3);
  color: #e0d8f0;
  transition:
    background 0.15s,
    opacity 0.15s;
}

.detail-action-btn:hover:not(:disabled) {
  background: rgba(120, 90, 200, 0.45);
}

.detail-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.detail-action-btn.action-success {
  background: rgba(78, 201, 176, 0.2);
  color: #4ec9b0;
}

.detail-action-btn.action-error {
  background: rgba(244, 71, 71, 0.2);
  color: #f44747;
}

.action-error-msg {
  margin-top: 4px;
  font-size: 11px;
  color: #f44747;
  max-width: 500px;
  word-break: break-word;
}

.action-success-msg {
  margin-top: 4px;
  font-size: 11px;
  color: #4ec9b0;
  max-width: 500px;
  word-break: break-word;
}
