/* Site Builder Builder — Developer → Widgets
   The Developer page's frame (app.css .dev-main) with one glass band a tool:
   its logo and name, then its widgets as cards — the widget's shape in a
   still preview, what it is, the keys it reads, and the switch that puts it
   in the editor's Widget library (app.css .sec-switch). A card in the menu
   wears the maroon edge the menu's armed card does. */

/* the Developer page's card: the tools' logos, one after another */
.wg-thumb { display: grid; grid-template-columns: repeat(4, 1fr); align-content: center; gap: 12px; padding: 22px 28px; }
.wg-thumb span {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; background: #FFFFFF;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-rest);
  animation: wg-bob 3.2s var(--ease-out) calc(var(--k) * .18s) infinite;
}
.wg-thumb img { width: 52%; height: 52%; object-fit: contain; }
@keyframes wg-bob { 0%, 70%, 100% { transform: none; } 35% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .wg-thumb span { animation: none; } }

.wg-crumb { font: 700 15px var(--sans); margin-left: 10px; }
.wg-crumb span { color: var(--muted); font-weight: 500; }
.wg-summary { font: 600 12.5px var(--sans); color: var(--muted); }
.wg-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
/* Light / Dark: which theme the previews show */
.wg-look { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .62); border: 1px solid var(--line-soft); }
.wg-look button {
  padding: 5px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 12px var(--sans); cursor: pointer;
  transition: background .16s var(--ease-out), color .16s var(--ease-out);
}
.wg-look button:hover { color: var(--ink); }
.wg-look button[aria-pressed="true"] { background: #111111; color: #FFFFFF; }
.wg-prev.dark { background: #0E0F11; }
.wg-list { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }

.wg-svc {
  padding: 16px 18px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-rest), inset 0 1px 0 rgba(255, 255, 255, .7);
  animation: wg-in .36s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes wg-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .wg-svc { animation: none; } }
.wg-svc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wg-svc-head h2 { margin: 0; flex: 1; font: 800 18px/1.2 var(--display); letter-spacing: -.01em; color: #111111; }
.wg-svc-n { font: 400 11.5px var(--mono); color: var(--muted); }
.wg-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #FFFFFF; border: 1px solid var(--line-soft); overflow: hidden; flex-shrink: 0; }
.wg-logo img { width: 22px; height: 22px; object-fit: contain; }
.wg-logo.mono { font: 800 14px var(--sans); color: var(--accent-deep); background: var(--accent-soft); }
.wg-none { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 760px; }

.wg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.wg-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: rgba(255, 255, 255, .62); border: 1px solid var(--line-soft); border-radius: 14px;
  transition: border-color .2s var(--ease-out), box-shadow .3s var(--ease-out);
}
.wg-card.on { border-color: rgba(123, 30, 46, .4); box-shadow: 0 0 0 3px var(--accent-soft); }
/* the widget's shape at 3/5 of the menu card's 480 × 300 */
.wg-prev { height: 180px; overflow: hidden; display: grid; justify-content: center; background: #FFFFFF; border-bottom: 1px solid var(--line-soft); }
.wg-prev iframe { width: 480px; height: 300px; border: 0; transform: scale(.6); transform-origin: 50% 0; pointer-events: none; }
.wg-body { padding: 12px 14px 4px; flex: 1; }
.wg-body h3 { margin: 0 0 4px; font: 700 14px var(--sans); color: var(--ink); }
.wg-body p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.wg-needs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.wg-needs > span { font: 700 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; margin-right: 2px; }
.wg-needs code { font: 400 11px var(--mono); background: rgba(26, 26, 26, .06); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
.wg-switch { padding: 10px 14px 14px; flex: none; }

/* deleting one: a round trash over its preview's corner (Undo rides on the toast).
   The preview is white in every theme, so its ink is fixed. */
.wg-card { position: relative; }
.wg-del {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border-radius: 999px; border: 1px solid rgba(17, 17, 17, .16); background: #FFFFFF; color: #3A3A3A; cursor: pointer;
  opacity: .75; box-shadow: 0 2px 8px rgba(17, 17, 17, .12);
  transition: transform .32s var(--ease-spring), opacity .16s var(--ease-out), color .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out);
}
.wg-del svg { width: 15px; height: 15px; }
.wg-card:hover .wg-del, .wg-del:focus-visible { opacity: 1; }
.wg-del:hover { color: #A32B23; border-color: rgba(220, 70, 60, .5); background: #FDF1EF; transform: translateY(-1px); }
.wg-del:active { transform: translateY(1px) scale(.94); transition-duration: .06s; }
.wg-del:disabled { opacity: .4; cursor: default; }
.wg-tag { margin-left: 8px; padding: 1px 7px; border-radius: 999px; font: 700 10px var(--sans); letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; color: var(--accent-deep); background: var(--accent-soft); }
/* the one just made */
.wg-card.wg-fresh { animation: wg-fresh 1.6s var(--ease-out); }
@keyframes wg-fresh { 0%, 40% { box-shadow: 0 0 0 4px rgba(123, 30, 46, .45); } }

/* a tool's own New widget, in its band's head or where it has none yet */
.wg-make { padding: 5px 11px; font-size: 12px; }
.wg-none-act { margin: 10px 0 0; }

/* categories under a tool: a kicker heading with its count, a pencil and a
   trash that show on hover, then the category's cards (or a dashed strip
   when it is empty) */
.wg-cat + .wg-cat { margin-top: 16px; }
.wg-cat-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; min-height: 26px; }
.wg-cat-head h3 { margin: 0; font: 700 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.wg-cat-btn {
  display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--muted); opacity: 0;
  transition: opacity .16s var(--ease-out), color .16s var(--ease-out), background .16s var(--ease-out), border-color .16s var(--ease-out), transform .32s var(--ease-spring);
}
.wg-cat-btn svg { width: 13px; height: 13px; }
.wg-cat-head:hover .wg-cat-btn, .wg-cat-btn:focus-visible { opacity: 1; }
.wg-cat-btn:hover { color: var(--accent-deep); background: var(--accent-soft); border-color: var(--line-soft); }
.wg-cat-btn.del:hover { color: #A32B23; background: #FDF1EF; border-color: rgba(220, 70, 60, .4); }
.wg-cat-btn:active { transform: scale(.92); transition-duration: .06s; }
.wg-cat-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wg-cat-empty { margin: 0; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 12.5px; color: var(--muted); }
/* a card's Category menu */
.wg-catpick { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.wg-catpick > span { font: 700 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.wg-catpick select { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12.5px; }
@media (hover: none) { .wg-cat-btn { opacity: 1; } }

/* Deleted: what was taken off the page, each to bring back */
.wg-gone-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wg-gone-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .5); border: 1px solid var(--line-soft); }
.wg-gone-name { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); }

/* New widget */
.modal.wg-modal { max-width: 580px; max-height: 92vh; overflow-y: auto; }
.wg-form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.wg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wg-field[hidden] { display: none; }
.wg-field.wide { grid-column: 1 / -1; }
.wg-field input[type="color"] { width: 88px; height: 40px; padding: 4px 6px; cursor: pointer; }
.wg-f-help { font-size: 12px; line-height: 1.45; color: var(--muted); }
.wg-f-none { margin: 0; font-size: 12.5px; color: var(--muted); }
.wg-try { padding-top: 6px; border-top: 1px solid var(--line-soft); }
.wg-try-row { display: flex; gap: 8px; }
.wg-try-row input { flex: 1; min-width: 0; }
.wg-try-row .btn { flex: none; }
.wg-try-out { padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.wg-try-out.ok { background: rgba(31, 138, 91, .1); border: 1px solid rgba(31, 138, 91, .35); color: var(--ink); }
.wg-try-out.bad { background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--danger-ink); }
.wg-try-out a { color: inherit; font-weight: 600; }
.wg-try-out ul { margin: 6px 0 0; padding-left: 18px; }
.wg-try-out li.warn { color: var(--ink); }
.wg-form-err { margin: 12px 0 0; padding: 9px 12px; border-radius: 12px; font-size: 13px; color: var(--danger-ink); background: var(--danger-bg); border: 1px solid var(--danger-line); }
@media (prefers-reduced-motion: reduce) { .wg-card.wg-fresh { animation: none; } .wg-del { transition: none; } }

/* the editor menu's Widget library rows wear the tool's logo */
.mr-ic .mr-logo { width: 16px; height: 16px; object-fit: contain; }

@media (max-width: 760px) {
  .wg-grid { grid-template-columns: minmax(0, 1fr); }
  .wg-prev { height: 150px; }
  .wg-prev iframe { transform: scale(.5); }
  .wg-form { grid-template-columns: 1fr; }
}
