/* ══════════════════════════════════════
   LDP Generator — Styles
   ══════════════════════════════════════ */

:root {
  --brand: #00AFF0;
  --brand-dark: #000064;
  --accent: #6446FF;
  --bg: #f5f7fa;
  --bg-white: #ffffff;
  --bg-dark: #0a0e1a;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --green: #14E69B;
  --coral: #FF5A6E;
  --yellow: #FFD200;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
  --panel-left-width: 380px;
  --topbar-height: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans TC', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* ── Top Bar ── */
.top-bar {
  height: var(--topbar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  position: relative;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 28px;
}

.top-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
}

.top-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Buttons ── */
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 0.9rem;
}
.btn-icon:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(0,175,240,0.05);
}
.btn-icon.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-primary {
  width: 100%;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

/* ── App Layout ── */
.app-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height));
}

/* ── Left Panel ── */
.panel-left {
  width: var(--panel-left-width);
  min-width: var(--panel-left-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

.panel-left.collapsed {
  margin-left: calc(var(--panel-left-width) * -1);
}

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ── Step Indicator ── */
.step-indicator {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}

.step-dot {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 2px solid var(--border);
  transition: all var(--transition);
}

.step-dot span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
}

.step-dot.active {
  color: var(--brand);
  border-color: var(--brand);
}
.step-dot.active span {
  background: var(--brand);
  color: #fff;
}
.step-dot.done {
  color: var(--green);
  border-color: var(--green);
}
.step-dot.done span {
  background: var(--green);
  color: #fff;
}

/* ── Step Panels ── */
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ── Form ── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.label-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.form-group textarea,
.form-group input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  transition: border-color var(--transition);
}

.form-group textarea:focus,
.form-group input[type="text"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,175,240,0.1);
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--brand);
  background: rgba(0,175,240,0.03);
}

.upload-icon {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.upload-link {
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

/* ── File List ── */
.file-list {
  margin-top: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.file-item .file-icon {
  color: var(--brand);
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.file-item .file-size {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.file-item .file-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}

.file-item .file-status.parsed {
  background: rgba(20,230,155,0.1);
  color: var(--green);
}

.file-item .file-status.parsing {
  background: rgba(0,175,240,0.1);
  color: var(--brand);
}

.file-item .file-status.error {
  background: rgba(255,90,110,0.1);
  color: var(--coral);
}

.file-item .file-remove {
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border: none;
  background: none;
  font-size: 0.9rem;
}
.file-item .file-remove:hover { color: var(--coral); }

/* ── Upload Progress ── */
.upload-progress {
  margin-top: 8px;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* ── Plan Review ── */
.plan-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-suggestion {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(0,175,240,0.04);
  border-radius: var(--radius);
  border-left: 3px solid var(--brand);
}

/* ── Theme Selector ── */
.plan-theme {
  margin-bottom: 16px;
}
.plan-theme label {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.theme-option input { display: none; }

.theme-option:has(input:checked) {
  border-color: var(--brand);
  background: rgba(0,175,240,0.05);
  color: var(--brand);
}

.theme-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: block;
}

.plan-title-group {
  margin-bottom: 16px;
}
.plan-title-group label {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}
.plan-title-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
}
.plan-title-group input:focus {
  outline: none;
  border-color: var(--brand);
}

/* ── Section Cards ── */
.section-list {
  margin-bottom: 16px;
}

.section-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--bg-white);
  transition: all var(--transition);
  cursor: grab;
}

.section-card:hover {
  border-color: rgba(0,175,240,0.3);
  box-shadow: var(--shadow);
}

.section-card.disabled {
  opacity: 0.45;
}

.section-toggle {
  margin-top: 2px;
  flex-shrink: 0;
}

.section-toggle input[type="checkbox"] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.section-info {
  flex: 1;
  min-width: 0;
}

.section-info h4 {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-type-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(0,175,240,0.1);
  color: var(--brand);
}

.section-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-drag {
  color: var(--text-muted);
  cursor: grab;
  font-size: 0.9rem;
  padding: 2px;
  flex-shrink: 0;
}

/* ── Plan Actions ── */
.plan-actions {
  display: flex;
  gap: 8px;
}

.plan-actions .btn-primary { flex: 1; }
.plan-actions .btn-secondary { flex-shrink: 0; }

/* ── Generation Status ── */
.gen-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.gen-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
.gen-spinner.large {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.gen-status p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.gen-done {
  text-align: center;
  padding: 40px 20px;
}

.gen-done-icon {
  font-size: 3rem;
  color: var(--green);
  margin-bottom: 12px;
}

.gen-done p {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.gen-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Right Panel ── */
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* ── Preview Toolbar ── */
.preview-toolbar {
  height: 44px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.preview-tabs {
  display: flex;
  gap: 2px;
}

.preview-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}
.preview-tab:hover { color: var(--text); background: var(--bg); }
.preview-tab.active {
  color: var(--brand);
  background: rgba(0,175,240,0.08);
}

.preview-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-switcher {
  display: flex;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}

.device-btn {
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.device-btn:hover { color: var(--text); }
.device-btn.active {
  background: var(--brand);
  color: #fff;
}

/* ── Preview Container ── */
.preview-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.preview-pane,
.code-pane {
  position: absolute;
  inset: 0;
  display: none;
}
.preview-pane.active,
.code-pane.active {
  display: flex;
  flex-direction: column;
}

/* Split mode */
.preview-container.split-mode .preview-pane,
.preview-container.split-mode .code-pane {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 50%;
}
.preview-container.split-mode {
  display: flex;
}

/* ── Preview Frame ── */
.preview-frame-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}

.preview-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

/* Device widths */
.preview-frame-wrap.device-tablet iframe {
  max-width: 768px;
}
.preview-frame-wrap.device-mobile iframe {
  max-width: 375px;
}
.preview-frame-wrap.device-email iframe {
  max-width: 620px;
  border: 2px dashed var(--brand);
}

/* ── Preview Empty ── */
.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.preview-empty i {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}
.preview-empty p {
  font-size: 0.9rem;
}

/* ── Code Pane ── */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.code-filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #94a3b8;
}

.btn-copy {
  border-color: #475569;
  background: transparent;
  color: #94a3b8;
}
.btn-copy:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: rgba(0,175,240,0.1);
}

.code-body {
  flex: 1;
  overflow: auto;
  background: #0f172a;
}

.code-body pre {
  margin: 0;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
  counter-reset: line;
}

.code-line {
  display: block;
  padding-left: 50px;
  position: relative;
  min-height: 1.7em;
}

.code-line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  width: 40px;
  text-align: right;
  color: #475569;
  font-size: 0.72rem;
  user-select: none;
}

.code-line.highlight {
  background: rgba(0,175,240,0.12);
  border-left: 3px solid var(--brand);
  padding-left: 47px;
}

/* ── Inspector Bar ── */
.inspector-bar {
  height: 32px;
  background: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  flex-shrink: 0;
}

.inspector-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #f59e0b;
}

.inspector-section {
  font-size: 0.75rem;
  color: #94a3b8;
}

.inspector-bar .btn-icon {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #94a3b8;
  margin-left: auto;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: var(--bg-white);
  border-radius: 12px;
  width: 560px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.empty-hint {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 0.9rem;
}

/* History Items */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.history-item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.history-item .history-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.history-item .history-info {
  flex: 1;
  min-width: 0;
}

.history-item .history-title {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item .history-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.history-item .history-delete {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
}
.history-item .history-delete:hover { color: var(--coral); }

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-content {
  text-align: center;
}

.loading-content p {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }
  .panel-left {
    width: 100%;
    min-width: unset;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  :root {
    --panel-left-width: 100%;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Inspect Mode ── */
.inspect-mode .preview-frame-wrap iframe {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0,175,240,0.2), var(--shadow-lg);
}

/* ══════════════════════════════════════
   EDM Mode UI
   ══════════════════════════════════════ */

/* Mode Toggle */
.mode-toggle-group {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
}
.mode-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mode-btn.active {
  background: var(--bg-white);
  color: var(--brand);
  box-shadow: var(--shadow);
}
.mode-btn:hover:not(.active) {
  color: var(--text);
}

/* EDM Target Selector */
.edm-target-group {
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.edm-target-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-white);
}
.edm-target-btn input[type="radio"] {
  display: none;
}
.edm-target-btn i {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 1px;
  min-width: 18px;
  text-align: center;
}
.edm-target-btn span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.edm-target-btn small {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}
.edm-target-btn:hover {
  border-color: var(--brand);
  background: rgba(0,175,240,0.03);
}
.edm-target-btn.active {
  border-color: var(--brand);
  background: rgba(0,175,240,0.06);
}
.edm-target-btn.active i,
.edm-target-btn.active span {
  color: var(--brand);
}

/* EDM 色彩設定 */
.edm-colors-group {
  margin-bottom: 14px;
}
.edm-colors-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.edm-color-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  margin-bottom: 6px;
}
.edm-color-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.edm-color-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.edm-color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.edm-color-picker {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}
.edm-color-hex {
  width: 76px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  background: var(--bg);
}
.edm-color-hex:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-white);
}

/* HubSpot 提示橫幅 */
.hubspot-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 122, 0, 0.08);
  border: 1px solid rgba(255, 122, 0, 0.25);
  border-radius: var(--radius);
  color: #b85c00;
  font-size: 0.8rem;
  margin-bottom: 14px;
}
.hubspot-banner i {
  flex-shrink: 0;
  font-size: 1rem;
}
.hubspot-banner code {
  background: rgba(255,122,0,0.12);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.75rem;
}

/* ── Edit Panel ── */
.edit-panel {
  border-top: 1px solid var(--border);
  padding: 20px;
  background: var(--bg-white);
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.edit-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.quick-edit-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.quick-edit-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag-badge {
  background: var(--brand);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
}

.quick-edit-row {
  margin-bottom: 8px;
}
.quick-edit-row label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.quick-edit-row input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.quick-edit-row input:focus {
  outline: none;
  border-color: var(--brand);
}

.chat-edit-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-target {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 175, 240, 0.1);
  border: 1px solid rgba(0, 175, 240, 0.3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--brand-dark);
}
.chat-target .target-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-small {
  padding: 4px 8px;
  font-size: 0.75rem;
  height: auto;
}
