
.gpt-template-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line, #f1c5d8);
  border-radius: 16px;
  color: var(--ink, #3b2040);
  background: linear-gradient(120deg, var(--soft, #fff0f6), rgba(255, 255, 255, .8));
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.gpt-template-menu:hover,
.gpt-template-menu-active {
  border-color: var(--deep, #ff6b9d);
  box-shadow: 0 4px 16px rgba(255, 107, 157, .12);
}
.gpt-template-menu:focus-visible { outline: 2px solid var(--deep, #ff6b9d); outline-offset: 3px; }
.gpt-template-menu-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--deep, #ff6b9d);
  background: white;
}
.gpt-template-menu-icon svg { width: 23px; height: 23px; }
.gpt-template-menu-label { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.gpt-template-menu-label strong { font-size: 14px; font-weight: 700; }
.gpt-template-menu-label small { font-size: 12px; color: var(--muted, #9a6f88); }
.gpt-template-menu-arrow { flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted, #9a6f88); }


.gpt-templates {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 28px clamp(18px, 3vw, 44px) 40px;
  color: var(--ink, #3b2040);
  background: radial-gradient(ellipse at top right, rgba(255, 226, 240, .5), transparent 55%);
  overscroll-behavior: contain;
}
.gpt-templates button, .gpt-templates input, .gpt-templates textarea { font: inherit; }
.gpt-templates button { cursor: pointer; }
.gpt-templates button:focus-visible, .gpt-templates a:focus-visible {
  outline: 2px solid var(--deep, #ff6b9d);
  outline-offset: 3px;
}
.gpt-templates-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.gpt-templates-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--muted, #9a6f88); }
.gpt-templates-header h2 { margin: 6px 0 8px; font-size: 28px; font-weight: 750; letter-spacing: 1px; }
.gpt-templates-header p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted, #9a6f88); }
.gpt-templates-button, .gpt-templates-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line, #f1c5d8);
  border-radius: 10px;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ink, #3b2040);
  background: rgba(255, 255, 255, .9);
}
.gpt-templates-button:hover { background: var(--soft, #fff0f6); }
.gpt-templates-primary { color: #fff; background: var(--deep, #ff6b9d); border-color: transparent; }
.gpt-templates-primary:hover { filter: brightness(.96); }
.gpt-templates-primary:disabled { opacity: .5; cursor: default; }
.gpt-templates-toolbar { margin-bottom: 22px; }
.gpt-templates-search { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border: 1px solid var(--line, #f1c5d8); background: rgba(255, 255, 255, .85); border-radius: 13px; }
.gpt-templates-search:focus-within { border-color: var(--deep, #ff6b9d); box-shadow: 0 0 0 3px rgba(255, 107, 157, .08); }
.gpt-templates-search svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--muted, #9a6f88); }
.gpt-templates-search input { width: 100%; min-width: 0; background: transparent; outline: none; border: 0; color: var(--ink, #3b2040); font-size: 13px; }
.gpt-templates-search input::placeholder { color: var(--muted, #9a6f88); }
.gpt-templates-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 0 10px; }
.gpt-templates-filters button { min-height: 32px; padding: 6px 13px; border: 1px solid transparent; border-radius: 999px; background: rgba(255, 255, 255, .72); color: var(--muted, #9a6f88); font-size: 12px; }
.gpt-templates-filters .gpt-templates-filter-selected { background: var(--soft-2, #ffe4ef); border-color: var(--line, #f1c5d8); color: var(--ink, #3b2040); font-weight: 650; }
.gpt-templates-count { font-size: 12px; color: var(--muted, #9a6f88); margin: 4px 0 0; }
.gpt-templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); align-items: start; gap: 20px; }
.gpt-templates-card { min-width: 0; overflow: hidden; border: 1px solid var(--line, #f1c5d8); border-radius: 17px; background: rgba(255, 255, 255, .85); transition: box-shadow .2s, transform .2s; }
.gpt-templates-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(133, 69, 103, .08); }
.gpt-templates-card-cover { display: block; position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; padding: 0; border: 0; background: var(--soft, #fff0f6); }
.gpt-templates-card-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.gpt-templates-image-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 170px; color: var(--muted, #9a6f88); background: linear-gradient(135deg, #fff1f5, #eee7ff); font-size: 15px; letter-spacing: 2px; }
.gpt-templates-cover-badge { position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; font-size: 11px; color: #604255; background: rgba(255, 255, 255, .94); border-radius: 7px; }
.gpt-templates-card-body { padding: 15px; }
.gpt-templates-category { display: block; font-size: 11px; color: var(--muted, #9a6f88); margin-bottom: 6px; }
.gpt-templates-card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; line-height: 1.5; }
.gpt-templates-card h3 button { text-align: left; border: 0; padding: 0; background: transparent; color: inherit; }
.gpt-templates-card-body > p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; font-size: 12px; line-height: 1.7; color: var(--muted, #9a6f88); margin: 0 0 16px; }
.gpt-templates-card-actions { display: flex; justify-content: space-between; gap: 8px; }
.gpt-templates-empty { text-align: center; padding: 60px 12px; color: var(--muted, #9a6f88); font-size: 14px; }
.gpt-templates-empty p { margin: 0 0 16px; }
.gpt-templates-back { display: block; border: 0; background: transparent; padding: 0; margin: 0 0 18px; color: var(--muted, #9a6f88); font-size: 13px !important; }
.gpt-templates-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 26px; }
.gpt-templates-detail-image { overflow: hidden; border-radius: 17px; background: var(--soft, #fff0f6); border: 1px solid var(--line, #f1c5d8); }
.gpt-templates-detail-image img { display: block; width: 100%; max-height: 65vh; object-fit: contain; }
.gpt-templates-tag { display: inline-block; font-size: 11px; color: var(--muted, #9a6f88); padding: 5px 9px; border-radius: 7px; background: var(--soft-2, #ffe4ef); }
.gpt-templates-detail h3 { font-size: 22px; line-height: 1.4; font-weight: 700; margin: 12px 0; }
.gpt-templates-description { color: var(--muted, #9a6f88); font-size: 13px; line-height: 1.8; margin: 0 0 14px; }
.gpt-templates-reference { padding: 12px; border-radius: 10px; background: #fff5de; color: #8a6427; font-size: 12px; line-height: 1.8; margin: 0 0 14px; }
.gpt-templates-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.gpt-templates-button-selected { color: var(--deep, #ff6b9d); background: var(--soft, #fff0f6); border-color: var(--deep, #ff6b9d); }
.gpt-templates-prompt-label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 9px; }
.gpt-templates-prompt { width: 100%; padding: 13px; border: 1px solid var(--line, #f1c5d8); border-radius: 12px; background: rgba(255, 255, 255, .9); color: var(--ink, #3b2040); font-size: 12px !important; line-height: 1.8; resize: vertical; margin-bottom: 13px; }
.gpt-templates-prompt:focus { outline: none; border-color: var(--deep, #ff6b9d); }
.gpt-templates-import-note { color: var(--muted, #9a6f88); font-size: 11px; line-height: 1.7; margin: 9px 0 18px; }
.gpt-templates-attribution { padding-top: 14px; border-top: 1px solid var(--line, #f1c5d8); font-size: 11px; line-height: 1.8; color: var(--muted, #9a6f88); }
.gpt-templates-attribution p { margin: 0 0 4px; }
.gpt-templates a { color: var(--muted, #9a6f88); text-decoration: underline; text-underline-offset: 3px; }
.gpt-templates-footer { margin-top: 30px; color: var(--muted, #9a6f88); font-size: 11px; line-height: 1.8; }
.gpt-templates-footer a:last-child { margin-left: 8px; white-space: nowrap; }
.gpt-template-import-message { position: absolute; z-index: 20; right: 20px; top: 15px; max-width: min(420px, calc(100% - 40px)); display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border: 1px solid var(--line, #f1c5d8); border-radius: 12px; background: #fffafc; color: var(--ink, #3b2040); box-shadow: 0 6px 20px rgba(133, 69, 103, .12); font-size: 12px; line-height: 1.7; }
.gpt-template-import-message button { border: 0; background: transparent; font-size: 18px; line-height: 1.2; color: var(--muted, #9a6f88); cursor: pointer; }
@media (min-width: 768px) and (max-width: 1250px) {
  .gpt-templates-detail { grid-template-columns: minmax(0, 1fr); }
  .gpt-templates-detail-image img { max-height: 40vh; }
}
@media (max-width: 767px) {
  .gpt-templates { padding: 18px 14px 180px; }
  .gpt-templates-header { gap: 10px; margin-bottom: 19px; }
  .gpt-templates-header h2 { font-size: 24px; }
  .gpt-templates-header > button { padding: 7px 10px; }
  .gpt-templates-header p { font-size: 12px; }
  .gpt-templates-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gpt-templates-card { border-radius: 12px; }
  .gpt-templates-card-body { padding: 11px; }
  .gpt-templates-card h3 { font-size: 13px; }
  .gpt-templates-card-body > p { font-size: 11px; min-height: 37px; margin-bottom: 10px; }
  .gpt-templates-card-actions { flex-wrap: wrap; gap: 6px; }
  .gpt-templates-card-actions button { flex: 1; min-height: 32px; padding: 6px 8px; font-size: 11px !important; }
  .gpt-templates-detail { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .gpt-templates-detail-image img { max-height: 42vh; }
  .gpt-template-import-message { top: 10px; right: 12px; max-width: calc(100% - 24px); z-index: 45; }
}
@media (max-width: 350px) {
  .gpt-templates-grid { grid-template-columns: minmax(0, 1fr); }
}
