/**
 * Prompt Tools Studio — Custom GPT, VIP, Projects, scrollbars
 * Matches Prompt Tools Redesign (standalone).html
 */
:root,
.mpt-theme-dark,
.mpt-wrap {
  --mpt-canvas: #071A1B;
  --mpt-canvas-2: #03100F;
  --mpt-card: #0C2827;
  --mpt-card2: #10322F;
  --mpt-heading: #FFFFFF;
  --mpt-text: #EAF2F0;
  --mpt-muted: #90A6A3;
  --mpt-border: rgba(180, 220, 214, 0.10);
  --mpt-border-2: rgba(180, 220, 214, 0.16);
  --mpt-gold: #FFC94D;
  --mpt-gold2: #F0A81E;
  --mpt-gold-ink: #071A1B;
  --mpt-glow: rgba(255, 201, 77, 0.16);
  --mpt-emerald: #34C6B3;
  --mpt-indigo: #9AA2FB;
  --mpt-success: #55E39B;
  --mpt-shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}

.mpt-theme-light {
  --mpt-canvas: #EDF2F1;
  --mpt-canvas-2: #E0E8E6;
  --mpt-card: #FFFFFF;
  --mpt-card2: #F4F8F7;
  --mpt-heading: #071A1B;
  --mpt-text: #17302E;
  --mpt-muted: #5C726F;
  --mpt-border: rgba(8, 32, 31, 0.09);
  --mpt-border-2: rgba(8, 32, 31, 0.15);
  --mpt-gold: #DE9E12;
  --mpt-gold2: #B87C05;
  --mpt-gold-ink: #FFFFFF;
  --mpt-glow: rgba(222, 158, 18, 0.14);
  --mpt-emerald: #159888;
  --mpt-indigo: #5960D4;
  --mpt-success: #16995E;
  --mpt-shadow-sm: 0 8px 22px -14px rgba(20, 48, 46, 0.22);
}

/* ── Thin dark scrollbars (Studio) ── */
.mpt-wrap,
.mpt-app-sidebar,
.mpt-app-main,
.mpt-scroll,
.mpt-gpt-messages,
.mpt-gpt-list,
.mpt-template-list,
.mpt-studio-editor-panel,
.mpt-create-messages,
.mpt-projects-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 220, 214, 0.28) transparent;
}
.mpt-wrap::-webkit-scrollbar,
.mpt-app-sidebar::-webkit-scrollbar,
.mpt-app-main::-webkit-scrollbar,
.mpt-scroll::-webkit-scrollbar,
.mpt-gpt-messages::-webkit-scrollbar,
.mpt-gpt-list::-webkit-scrollbar,
.mpt-template-list::-webkit-scrollbar,
.mpt-studio-editor-panel::-webkit-scrollbar,
.mpt-create-messages::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.mpt-wrap::-webkit-scrollbar-track,
.mpt-app-sidebar::-webkit-scrollbar-track,
.mpt-app-main::-webkit-scrollbar-track,
.mpt-scroll::-webkit-scrollbar-track,
.mpt-gpt-messages::-webkit-scrollbar-track,
.mpt-gpt-list::-webkit-scrollbar-track,
.mpt-template-list::-webkit-scrollbar-track,
.mpt-studio-editor-panel::-webkit-scrollbar-track,
.mpt-create-messages::-webkit-scrollbar-track {
  background: transparent;
}
.mpt-wrap::-webkit-scrollbar-thumb,
.mpt-app-sidebar::-webkit-scrollbar-thumb,
.mpt-app-main::-webkit-scrollbar-thumb,
.mpt-scroll::-webkit-scrollbar-thumb,
.mpt-gpt-messages::-webkit-scrollbar-thumb,
.mpt-gpt-list::-webkit-scrollbar-thumb,
.mpt-template-list::-webkit-scrollbar-thumb,
.mpt-studio-editor-panel::-webkit-scrollbar-thumb,
.mpt-create-messages::-webkit-scrollbar-thumb {
  background: rgba(180, 220, 214, 0.28);
  border-radius: 999px;
}
.mpt-wrap::-webkit-scrollbar-thumb:hover,
.mpt-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 201, 77, 0.45);
}

/* ── Studio toolbar ── */
.mpt-studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0 18px;
}
.mpt-studio-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mpt-indigo);
  background: color-mix(in srgb, var(--mpt-indigo) 15%, transparent);
  padding: 5px 12px;
  border-radius: 999px;
}
.mpt-studio-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 3-column GPT Studio ── */
.mpt-gpt-studio--redesign .mpt-studio-layout {
  display: grid;
  grid-template-columns: 250px 1fr 300px;
  gap: 16px;
  align-items: start;
}
.mpt-gpt-studio--redesign .mpt-studio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 160px);
  overflow: auto;
}
.mpt-gpt-studio--redesign .mpt-studio-panel {
  background: var(--mpt-card);
  border: 1px solid var(--mpt-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--mpt-shadow-sm);
  margin-bottom: 0;
}
.mpt-gpt-studio--redesign .mpt-studio-panel h3 {
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--mpt-heading);
}
.mpt-gpt-list,
.mpt-template-list {
  max-height: 220px;
  overflow-y: auto;
}
.mpt-gpt-list-item,
.mpt-template-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid var(--mpt-border);
  background: var(--mpt-card2);
  cursor: pointer;
  margin-bottom: 8px;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.mpt-gpt-list-item:hover,
.mpt-template-btn:hover {
  border-color: var(--mpt-border-2);
}
.mpt-gpt-list-item.mpt-active {
  background: color-mix(in srgb, var(--mpt-gold) 10%, var(--mpt-card2));
  border-color: color-mix(in srgb, var(--mpt-gold) 45%, transparent);
}
.mpt-gpt-list-title,
.mpt-template-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--mpt-heading);
}
.mpt-template-desc,
.mpt-gpt-list-item .mpt-muted {
  display: block;
  font-size: 11.5px;
  color: var(--mpt-muted);
  margin-top: 2px;
}

.mpt-gpt-studio--redesign .mpt-studio-chat {
  background: var(--mpt-card);
  border: 1px solid var(--mpt-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  box-shadow: var(--mpt-shadow-sm);
  overflow: hidden;
}
.mpt-studio-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--mpt-border);
  flex-wrap: wrap;
}
.mpt-studio-chat-header strong {
  font-size: 14.5px;
  color: var(--mpt-heading);
}
.mpt-studio-chat-header .mpt-muted {
  display: block;
  font-size: 12px;
}
.mpt-studio-chat-modes {
  display: flex;
  gap: 6px;
  background: var(--mpt-card2);
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--mpt-border);
}
.mpt-gpt-mode {
  border: none;
  background: transparent;
  color: var(--mpt-muted);
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.mpt-gpt-mode.mpt-active {
  background: linear-gradient(135deg, var(--mpt-gold), var(--mpt-gold2));
  color: var(--mpt-gold-ink);
}
.mpt-gpt-messages {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  min-height: 280px;
  max-height: 420px;
}
.mpt-gpt-msg {
  max-width: 82%;
  padding: 14px 16px;
  border-radius: 14px 14px 14px 4px;
  background: var(--mpt-card2);
  border: 1px solid var(--mpt-border);
}
.mpt-gpt-msg.mpt-gpt-user {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mpt-gold) 22%, var(--mpt-card)), var(--mpt-card2));
  border-color: var(--mpt-border-2);
}
.mpt-gpt-msg.mpt-gpt-assistant {
  align-self: flex-start;
}
.mpt-gpt-msg strong {
  display: block;
  font-size: 12px;
  color: var(--mpt-indigo);
  margin-bottom: 5px;
}
.mpt-gpt-msg.mpt-gpt-user strong { color: var(--mpt-gold); }
.mpt-gpt-msg p,
.mpt-gpt-msg pre {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--mpt-text);
  white-space: pre-wrap;
  font-family: inherit;
}
.mpt-gpt-form {
  padding: 14px 18px;
  border-top: 1px solid var(--mpt-border);
}
.mpt-gpt-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.mpt-gpt-composer textarea {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--mpt-border-2);
  background: var(--mpt-card2);
  color: var(--mpt-text);
  font-size: 14px;
  resize: none;
  min-height: 46px;
  font-family: inherit;
}
.mpt-gpt-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ── Editor / Create–Configure (match Freeform Assistant height) ── */
.mpt-gpt-studio--redesign .mpt-studio-layout {
  align-items: stretch;
}
.mpt-studio-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 560px;
  height: 100%;
  max-height: none;
}
.mpt-studio-editor-panel {
  flex: 1 1 auto;
  min-height: 560px;
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.mpt-cc-pane.is-active,
.mpt-cc-pane:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#mpt-cc-pane-configure {
  gap: 0;
}
.mpt-create-messages {
  flex: 1;
  min-height: 280px;
  max-height: none;
}
.mpt-cc-toggle {
  display: flex;
  gap: 4px;
  background: var(--mpt-card2);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--mpt-border);
  margin-bottom: 16px;
}
.mpt-cc-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--mpt-muted);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.mpt-cc-btn.is-active {
  background: color-mix(in srgb, var(--mpt-card) 90%, #fff);
  color: var(--mpt-heading);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}
.mpt-theme-dark .mpt-cc-btn.is-active {
  background: #2a2a2a;
  color: #fff;
}
.mpt-cc-pane[hidden] { display: none !important; }
.mpt-config-heading {
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--mpt-heading);
}
.mpt-field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--mpt-text);
  margin: 0 0 6px;
}
.mpt-gpt-studio .mpt-input,
.mpt-gpt-studio .mpt-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--mpt-border-2);
  background: var(--mpt-card2);
  color: var(--mpt-text);
  font-size: 13.5px;
  margin-bottom: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.mpt-gpt-studio textarea.mpt-input { resize: vertical; line-height: 1.5; }

.mpt-knowledge-block {
  margin: 4px 0 16px;
  padding-top: 4px;
}
.mpt-knowledge-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--mpt-heading);
}
.mpt-knowledge-note {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--mpt-muted);
  line-height: 1.45;
}
.mpt-upload-files-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 999px;
  background: #2f2f2f;
  border: 1px solid #4d4d4d;
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 12px;
}
.mpt-theme-light .mpt-upload-files-btn {
  background: #e8eceb;
  border-color: #c5cecc;
  color: #17302E;
}
.mpt-gpt-file-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.mpt-gpt-file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--mpt-card2);
  border: 1px solid var(--mpt-border);
  font-size: 12.5px;
  margin-bottom: 6px;
}
.mpt-file-remove {
  border: none;
  background: transparent;
  color: var(--mpt-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.mpt-config-section { margin: 8px 0 18px; }
.mpt-config-section-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mpt-heading);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mpt-info-dot {
  display: inline-flex;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--mpt-muted);
  color: var(--mpt-muted);
  font-size: 10px;
  align-items: center;
  justify-content: center;
  cursor: help;
}
.mpt-config-help {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--mpt-muted);
}
.mpt-cap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--mpt-text);
  margin-bottom: 8px;
  cursor: pointer;
}
.mpt-cap-row input { accent-color: var(--mpt-gold); width: 16px; height: 16px; }
.mpt-studio-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.mpt-studio-editor-actions .mpt-btn { flex: 1; justify-content: center; text-align: center; }

.mpt-create-messages {
  min-height: 280px;
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  flex: 1;
}
.mpt-create-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mpt-create-form .mpt-input {
  margin-bottom: 0;
  border-radius: 999px;
  padding: 12px 16px;
}
.mpt-create-form .mpt-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  flex: none;
  font-size: 18px;
}
.mpt-create-hint { margin: 10px 0 0; font-size: 12px; }

.mpt-module-mini-list { list-style: none; margin: 0; padding: 0; }
.mpt-module-mini-btn {
  background: none;
  border: none;
  color: var(--mpt-gold);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  font-family: inherit;
  text-align: left;
}
.mpt-link-sm {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mpt-gold);
}

/* ── VIP Modules grid ── */
.mpt-vip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding-top: 8px;
}
.mpt-vip-card {
  background: var(--mpt-card);
  border: 1px solid var(--mpt-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--mpt-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mpt-vip-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--mpt-heading);
}
.mpt-vip-card p {
  margin: 0;
  font-size: 13px;
  color: var(--mpt-muted);
  line-height: 1.55;
  flex: 1;
}
.mpt-vip-card .mpt-btn { align-self: flex-start; }
.mpt-vip-ico {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mpt-vip-ico.gold {
  background: color-mix(in srgb, var(--mpt-gold) 15%, transparent);
  color: var(--mpt-gold);
}
.mpt-vip-ico.emerald {
  background: color-mix(in srgb, var(--mpt-emerald) 15%, transparent);
  color: var(--mpt-emerald);
}
.mpt-vip-ico.indigo {
  background: color-mix(in srgb, var(--mpt-indigo) 14%, transparent);
  color: var(--mpt-indigo);
}

/* ── Projects layout ── */
.mpt-projects-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
  align-items: start;
  padding-top: 8px;
}
.mpt-projects-new {
  background: var(--mpt-card);
  border: 1px solid var(--mpt-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--mpt-shadow-sm);
}
.mpt-projects-new-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 800;
  color: var(--mpt-heading);
}
.mpt-projects-new .mpt-field input,
.mpt-projects-new .mpt-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--mpt-border-2);
  background: var(--mpt-card2);
  color: var(--mpt-text);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.mpt-btn-block { width: 100%; justify-content: center; }
.mpt-project-card {
  display: flex !important;
  align-items: center;
  gap: 14px;
  background: var(--mpt-card) !important;
  border: 1px solid var(--mpt-border) !important;
  border-radius: 16px !important;
  padding: 18px !important;
  box-shadow: var(--mpt-shadow-sm);
  margin-bottom: 12px;
}
.mpt-project-ico {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--mpt-indigo) 14%, transparent);
  color: var(--mpt-indigo);
}
.mpt-project-body { flex: 1; min-width: 0; }
.mpt-project-body strong {
  display: block;
  font-size: 14.5px;
  color: var(--mpt-heading);
}
.mpt-project-status {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mpt-success);
  background: color-mix(in srgb, var(--mpt-success) 14%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.mpt-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
}
.mpt-project-actions .aptf-btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
}

@media (max-width: 1100px) {
  .mpt-gpt-studio--redesign .mpt-studio-layout {
    grid-template-columns: 1fr;
  }
  .mpt-gpt-studio--redesign .mpt-studio-sidebar,
  .mpt-studio-editor {
    max-height: none;
  }
  .mpt-projects-layout { grid-template-columns: 1fr; }
}

/* ── Single theme icon toggle (header) ── */
.mpt-theme-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--mpt-card);
  border: 1px solid var(--mpt-border);
  color: var(--mpt-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
}
.mpt-theme-icon-btn:hover {
  border-color: var(--mpt-border-2, var(--mpt-border));
  color: var(--mpt-gold);
}
.mpt-theme-dark .mpt-theme-ico-moon,
.mpt-theme-light .mpt-theme-ico-sun { display: none; }
.mpt-theme-dark .mpt-theme-ico-sun,
.mpt-theme-light .mpt-theme-ico-moon { display: block; }

/* Hide duplicate Dark/Light pills inside tool/module pages */
.mpt-app-content .aptf-theme-toggle-wrap,
.mpt-app-wrap .aptf-theme-toggle-wrap {
  display: none !important;
}

/* Back button / long arrow */
.mpt-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid var(--mpt-border);
  background: var(--mpt-card);
  color: var(--mpt-text) !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  flex: none;
}
.mpt-back-btn:hover {
  border-color: var(--mpt-gold);
  color: var(--mpt-gold) !important;
}
.mpt-back-row {
  padding: 0 34px 10px;
}
.mpt-back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--mpt-border);
  background: var(--mpt-card);
  color: var(--mpt-text) !important;
  text-decoration: none !important;
}
.mpt-back-arrow:hover {
  border-color: var(--mpt-gold);
  color: var(--mpt-gold) !important;
}

/* ── Light mode: readable cards & forms ── */
.mpt-theme-light .mpt-inception-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #0f3d3a 100%) !important;
  color: #f8fafc !important;
}
.mpt-theme-light .mpt-inception-hero h2,
.mpt-theme-light .mpt-inception-hero p,
.mpt-inception-hero h2,
.mpt-inception-hero p {
  color: #f8fafc !important;
}
.mpt-inception-hero .mpt-studio-badge {
  color: #e9d5ff !important;
  background: rgba(168, 85, 247, 0.25) !important;
}

.mpt-theme-light .aptf-form-field label,
.mpt-theme-light .aptf-input-panel h2,
.mpt-theme-light .aptf-output-panel h2,
.mpt-theme-light .aptf-module-runner label,
.mpt-theme-light .aptf-tool-runner label {
  color: #0f172a !important;
}
.mpt-theme-light .aptf-form-field input,
.mpt-theme-light .aptf-form-field select,
.mpt-theme-light .aptf-form-field textarea,
.mpt-theme-light .aptf-module-runner input,
.mpt-theme-light .aptf-module-runner select,
.mpt-theme-light .aptf-module-runner textarea,
.mpt-theme-light .mpt-input,
.mpt-theme-light .mpt-select,
.mpt-theme-light .mpt-projects-new input,
.mpt-theme-light .mpt-projects-new textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
}
.mpt-theme-light .aptf-form-field input::placeholder,
.mpt-theme-light .aptf-form-field textarea::placeholder,
.mpt-theme-light .mpt-projects-new input::placeholder,
.mpt-theme-light .mpt-projects-new textarea::placeholder {
  color: #64748b !important;
  opacity: 1;
}
.mpt-theme-light .aptf-input-panel,
.mpt-theme-light .aptf-output-panel,
.mpt-theme-light .mpt-studio-panel,
.mpt-theme-light .mpt-vip-card,
.mpt-theme-light .mpt-projects-new,
.mpt-theme-light .mpt-project-card,
.mpt-theme-light .mpt-studio-chat {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}
.mpt-theme-light .mpt-gpt-msg {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}
.mpt-theme-light .mpt-gpt-msg strong { color: #4f46e5 !important; }
.mpt-theme-light .mpt-gpt-msg.mpt-gpt-user {
  background: #fff7e0 !important;
}
.mpt-theme-light .mpt-field-label,
.mpt-theme-light .mpt-config-heading,
.mpt-theme-light .mpt-knowledge-title,
.mpt-theme-light .mpt-config-section-title,
.mpt-theme-light .mpt-projects-new-title,
.mpt-theme-light .mpt-studio-panel h3,
.mpt-theme-light .mpt-vip-card h3 {
  color: #0f172a !important;
}
.mpt-theme-light .mpt-muted,
.mpt-theme-light .mpt-knowledge-note,
.mpt-theme-light .mpt-config-help,
.mpt-theme-light .mpt-vip-card p {
  color: #475569 !important;
}

/* Plan badge on auth */
.mpt-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mpt-gold) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--mpt-gold) 40%, transparent);
}
.mpt-plan-badge-label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--mpt-gold);
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.mpt-plan-badge-name {
  display: none;
}
.mpt-invite-note {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--mpt-muted);
}

/* VIP modules grid */
.mpt-vip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-top: 8px;
}
.mpt-vip-card {
  background: var(--mpt-card);
  border: 1px solid var(--mpt-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--mpt-shadow-sm, 0 8px 24px -12px rgba(0,0,0,.5));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mpt-vip-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--mpt-heading, var(--mpt-text));
}
.mpt-vip-card p {
  margin: 0;
  flex: 1;
  font-size: 13px;
  color: var(--mpt-muted);
  line-height: 1.55;
}
.mpt-vip-card .mpt-btn { align-self: flex-start; }
.mpt-vip-ico {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mpt-vip-ico.gold { background: color-mix(in srgb, var(--mpt-gold) 15%, transparent); color: var(--mpt-gold); }
.mpt-vip-ico.emerald { background: color-mix(in srgb, var(--mpt-emerald) 15%, transparent); color: var(--mpt-emerald); }
.mpt-vip-ico.indigo { background: color-mix(in srgb, var(--mpt-indigo, #9AA2FB) 14%, transparent); color: var(--mpt-indigo, #9AA2FB); }

/* Projects */
.mpt-projects-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 20px;
  align-items: start;
  padding-top: 8px;
}
.mpt-projects-new {
  background: var(--mpt-card);
  border: 1px solid var(--mpt-border);
  border-radius: 18px;
  padding: 22px;
}
.mpt-projects-new-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
}
.mpt-btn-block { width: 100%; justify-content: center; }
.mpt-project-card {
  display: flex !important;
  align-items: center;
  gap: 14px;
  background: var(--mpt-card) !important;
  border: 1px solid var(--mpt-border) !important;
  border-radius: 16px !important;
  padding: 18px !important;
  margin-bottom: 12px;
}
.mpt-project-ico {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--mpt-indigo, #9AA2FB) 14%, transparent);
  color: var(--mpt-indigo, #9AA2FB);
}
.mpt-project-body { flex: 1; min-width: 0; }
.mpt-project-body strong { display: block; font-size: 14.5px; }
.mpt-project-status {
  font-size: 11.5px; font-weight: 700; color: var(--mpt-success, #55E39B);
  background: color-mix(in srgb, var(--mpt-success, #55E39B) 14%, transparent);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.mpt-project-actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .mpt-projects-layout { grid-template-columns: 1fr; }
}

/* -- White Label inline edit (no outlines / no popups) -- */
.mpt-inline-edit,
.mpt-brand-editable {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
body.mpt-wl-edit .mpt-inline-edit:not(a):not(button):not(.mpt-btn):not(.aptf-btn) {
  cursor: text;
}
.mpt-inline-edit[data-mpt-editing="1"],
.mpt-inline-edit [contenteditable="true"],
.mpt-inline-edit [contenteditable="plaintext-only"] {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
  caret-color: currentColor;
  cursor: text;
}
.mpt-ui-label {
  display: inline;
  outline: none !important;
}
.mpt-brand-appname {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mpt-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: text;
}
/* Hide legacy hint / toast UI if present */
.mpt-brand-hint,
.mpt-brand-toast {
  display: none !important;
}

/* -- Premium Custom GPT Builder -- */
.mpt-gpt-studio--premium { margin-top: 4px; }
.mpt-gb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--mpt-card) 88%, transparent);
  border: 1px solid var(--mpt-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.mpt-gb-topbar-left, .mpt-gb-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mpt-gb-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mpt-gold) 35%, #123), var(--mpt-card2));
  border: 1px solid var(--mpt-border);
  color: var(--mpt-gold);
  font-size: 18px;
  flex: none;
}
.mpt-gb-avatar--sm { width: 34px; height: 34px; font-size: 14px; }
.mpt-gb-identity strong { display: block; font-size: 15px; font-weight: 800; }
.mpt-gb-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.mpt-gb-autosave { font-size: 12px; color: var(--mpt-muted); }
.mpt-status-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px;
}
.mpt-status-badge.is-draft { background: rgba(148,163,184,.18); color: #cbd5e1; }
.mpt-status-badge.is-live { background: rgba(74,222,128,.16); color: #4ade80; }
.mpt-status-badge.is-private { background: rgba(96,165,250,.16); color: #60a5fa; }

.mpt-gpt-studio--premium .mpt-gb-layout {
  display: grid;
  grid-template-columns: 260px minmax(320px, 1.05fr) minmax(300px, .95fr);
  gap: 16px;
  align-items: start;
}
.mpt-gb-library, .mpt-gb-builder, .mpt-gb-preview {
  max-height: calc(100vh - 210px);
}
.mpt-gb-builder .mpt-studio-editor-panel,
.mpt-gb-preview {
  position: sticky;
  top: 72px;
}
.mpt-gb-lib-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px;
}
.mpt-gb-lib-head h3 { margin: 0; }
.mpt-gb-lib-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 10px;
  border: 1px solid var(--mpt-border); border-radius: 11px; background: var(--mpt-card2);
}
.mpt-gb-lib-search input {
  border: 0; background: transparent; color: var(--mpt-text); width: 100%; outline: none; font: inherit; font-size: 13px;
}
.mpt-gb-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mpt-gb-filter {
  border: 1px solid var(--mpt-border); background: transparent; color: var(--mpt-muted);
  border-radius: 999px; padding: 5px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.mpt-gb-filter.is-active, .mpt-gb-filter:hover {
  color: var(--mpt-gold); border-color: color-mix(in srgb, var(--mpt-gold) 45%, transparent);
  background: color-mix(in srgb, var(--mpt-gold) 10%, transparent);
}
.mpt-gpt-list-meta { display: block; font-size: 11px; margin: 2px 0 4px; }
.mpt-gpt-list-meta em { font-style: normal; color: var(--mpt-emerald); font-weight: 700; }
.mpt-template-ico {
  display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center;
  border-radius: 8px; margin-bottom: 6px; color: var(--mpt-gold);
  background: color-mix(in srgb, var(--mpt-gold) 12%, transparent);
}

.mpt-gb-section { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--mpt-border); }
.mpt-gb-section:last-of-type { border-bottom: 0; }
.mpt-gb-section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mpt-gb-instructions.is-expanded { min-height: 320px; }
.mpt-gb-instr-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mpt-cap-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.mpt-cap-card {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--mpt-border); background: var(--mpt-card2);
  font-size: 12.5px; font-weight: 650; cursor: pointer;
}
.mpt-cap-card:hover { border-color: color-mix(in srgb, var(--mpt-gold) 40%, transparent); }
.mpt-gb-drop.is-drag {
  outline: 1px dashed var(--mpt-gold);
  background: color-mix(in srgb, var(--mpt-gold) 8%, transparent);
}
.mpt-gb-preview-brand { display: flex; align-items: center; gap: 10px; }
.mpt-gpt-studio--premium .mpt-studio-chat {
  display: flex; flex-direction: column;
  background: var(--mpt-card);
  border: 1px solid var(--mpt-border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--mpt-shadow-sm);
  min-height: 520px;
}

.mpt-gb-modal[hidden] { display: none !important; }
.mpt-gb-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; }
.mpt-gb-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.mpt-gb-modal-card {
  position: relative; width: min(480px, 100%);
  background: var(--mpt-card); border: 1px solid var(--mpt-border);
  border-radius: 18px; padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.mpt-gb-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mpt-gb-modal-head h3 { margin: 0; font-size: 18px; }
.mpt-gb-modal-x {
  border: 0; background: transparent; color: var(--mpt-muted); font-size: 22px; cursor: pointer; line-height: 1;
}
.mpt-gb-vis-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.mpt-gb-vis-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: 14px; border: 1px solid var(--mpt-border);
  background: var(--mpt-card2); cursor: pointer;
}
.mpt-gb-vis-option.is-selected {
  border-color: color-mix(in srgb, var(--mpt-gold) 55%, transparent);
  background: color-mix(in srgb, var(--mpt-gold) 10%, transparent);
}
.mpt-gb-vis-option input { margin-top: 4px; }
.mpt-gb-vis-option strong { display: block; font-size: 13.5px; }
.mpt-gb-vis-option small { display: block; color: var(--mpt-muted); margin-top: 2px; }
.mpt-gb-vis-ico { font-size: 16px; line-height: 1.4; }
.mpt-gb-share-row { display: flex; gap: 8px; margin-bottom: 12px; }
.mpt-gb-share-row .mpt-input { flex: 1; }
.mpt-gb-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.mpt-dash-header-left .mpt-back-arrow {
  flex: none;
  margin-right: 2px;
}

@media (max-width: 1100px) {
  .mpt-gpt-studio--premium .mpt-gb-layout {
    grid-template-columns: 1fr 1fr;
  }
  .mpt-gb-library { grid-column: 1 / -1; max-height: none; }
}
@media (max-width: 760px) {
  .mpt-gpt-studio--premium .mpt-gb-layout { grid-template-columns: 1fr; }
  .mpt-gb-builder .mpt-studio-editor-panel,
  .mpt-gb-preview { position: static; max-height: none; }
  .mpt-cap-grid { grid-template-columns: 1fr; }
}
