/* ForceKIT Marketplace — catalogo degli script ufficiali (stessi colori e
   componenti di site.css: card come le .tool della home, chip come langnav). */
main.mk { max-width: 1160px; margin: 0 auto; padding: 48px 20px 80px; }
.mk-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.mk-hero h1 { margin: 6px 0 8px; font-size: clamp(32px, 4.6vw, 50px); font-weight: 850; line-height: 1.08; letter-spacing: -0.03em; }
.mk-hero h1 span { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mk-hero .lede { max-width: 640px; margin: 0; color: var(--text-dim); font-size: 17px; }
.mk-hero .eyebrow { margin: 0; color: var(--accent); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.mk-stat { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }
.mk-stat b { padding: 2px 8px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 11px; letter-spacing: .04em; }

/* barra: ricerca + filtri */
.mk-bar { position: sticky; top: 62px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 -8px 18px; padding: 10px 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.mk-search { display: flex; flex: 1 1 280px; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); color: var(--text-dimmer); }
.mk-search:focus-within { border-color: var(--accent-line); }
.mk-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg-2); }
.mk-chips button { padding: 7px 12px; border: none; border-radius: 9px; background: transparent; color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.mk-chips button:hover { color: var(--text); }
.mk-chips button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.mk-chips button .n { margin-left: 5px; color: var(--text-dimmer); font-weight: 600; }

/* griglia delle schede */
.mk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 960px) { .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .mk-grid { grid-template-columns: 1fr; } .mk-bar { position: static; } }
.mk-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.mk-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.mk-card-head { display: flex; align-items: center; gap: 12px; }
.mk-ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font: 800 12px/1 ui-monospace, Consolas, monospace; }
.mk-ic.emoji { font: 20px/1 system-ui, "Segoe UI Emoji", "Apple Color Emoji", sans-serif; }
.mk-ic.js { background: rgba(234, 179, 8, 0.14); color: #a16207; }
.mk-card h3 { margin: 0; font-size: 15.5px; letter-spacing: -0.01em; line-height: 1.3; }
.mk-card .by { color: var(--text-dimmer); font-size: 12.5px; }
.mk-card p { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.mk-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--text-dim); font-size: 11.5px; font-weight: 700; }
.mk-tag.type { background: var(--accent-soft); color: var(--accent); }
.mk-tag.type.js { background: rgba(234, 179, 8, 0.14); color: #a16207; }
.mk-tag.ok { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.mk-tag.up { background: rgba(217, 119, 6, 0.14); color: #b45309; }
.mk-tag.official::before { content: "✓"; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mk-ic.js, :root:not([data-theme="light"]) .mk-tag.type.js { color: #facc15; } }

/* stati: caricamento, vuoto, errore */
.mk-state { padding: 40px 20px; border-radius: 16px; border: 1px dashed var(--border); color: var(--text-dim); text-align: center; }
.mk-state.err { border-style: solid; border-color: rgba(220, 38, 38, 0.35); color: #b91c1c; }
.mk-state button { margin-top: 12px; }
.mk-spin { display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: mkSpin .8s linear infinite; }
@keyframes mkSpin { to { transform: rotate(360deg); } }

/* dettaglio */
.mk-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; font-weight: 700; font-size: 14px; }
.mk-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .mk-detail { grid-template-columns: 1fr; } }
.mk-panel { padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.mk-detail h1 { margin: 0 0 6px; font-size: clamp(26px, 3.4vw, 38px); font-weight: 850; letter-spacing: -0.02em; line-height: 1.15; }
.mk-detail .desc { margin: 12px 0 0; color: var(--text-dim); font-size: 15.5px; }
.mk-detail h2 { margin: 26px 0 10px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.mk-meta { display: grid; gap: 0; margin: 0; }
.mk-meta div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mk-meta div:last-child { border-bottom: none; }
.mk-meta dt { color: var(--text-dimmer); font-weight: 700; }
.mk-meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.mk-meta code { font: 12px/1.4 ui-monospace, Consolas, monospace; }
.mk-install { display: grid; gap: 10px; margin-top: 16px; }
.mk-install .btn { justify-content: center; }
.mk-install .hint { margin: 0; color: var(--text-dim); font-size: 13px; }
.mk-install .hint b { color: var(--text); }
.mk-code { position: relative; margin: 0; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-2); overflow: hidden; }
.mk-code-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border); color: var(--text-dim); font-size: 12.5px; font-weight: 700; }
.mk-code-bar .sp { flex: 1; }
.mk-code-bar button, .mk-code-bar a { padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.mk-code pre { max-height: 520px; margin: 0; padding: 14px 16px; overflow: auto; font: 12.5px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text); tab-size: 4; }
.mk-log { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.mk-log > li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.mk-log .v { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.mk-log .v span { color: var(--text-dimmer); font-weight: 600; font-size: 12.5px; }
.mk-log ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 13.5px; }
.mk-note { margin-top: 26px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text-dim); font-size: 14px; }
.mk-note b { color: var(--text); }

/* schede Script / Chiamate API in cima alle due pagine del Marketplace */
.mk-switch { display: inline-flex; gap: 4px; margin-bottom: 22px; padding: 3px; border-radius: 12px; background: var(--bg-2); }
.mk-switch a { padding: 7px 14px; border-radius: 9px; color: var(--text-dim); font-size: 13.5px; font-weight: 700; text-decoration: none; }
.mk-switch a:hover { color: var(--text); }
.mk-switch a.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

/* Chiamate API */
.api-dl-all { margin-left: auto; }
.api-grid { align-items: start; }
.api-card.open { grid-column: 1 / -1; }
.api-card p { -webkit-line-clamp: unset; display: block; }
.api-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.api-actions .btn { margin-left: auto; }
.api-toggle { padding: 4px 8px; border: none; border-radius: 8px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.api-toggle:hover { color: var(--accent); }
.api-site { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.api-reqs { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); list-style: none; }
.api-reqs li { display: grid; grid-template-columns: 58px minmax(120px, 1fr) minmax(0, 2fr); align-items: center; gap: 10px; font-size: 13px; }
.api-reqs code { overflow: hidden; color: var(--text-dimmer); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.api-m { justify-self: start; padding: 2px 7px; border-radius: 6px; background: var(--bg-2); font: 800 10.5px/1.4 ui-monospace, Consolas, monospace; }
.api-m-get { color: #15803d; background: rgba(22, 163, 74, .12); }
.api-m-post { color: #c2410c; background: rgba(234, 88, 12, .12); }
.api-m-put, .api-m-patch { color: #1d4ed8; background: rgba(37, 99, 235, .12); }
.api-m-delete { color: #b91c1c; background: rgba(220, 38, 38, .12); }
.api-m-soap { color: #7c3aed; background: rgba(124, 58, 237, .12); }
.api-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-dim); }
.api-vars code { padding: 2px 6px; border-radius: 6px; background: var(--bg-2); font-size: 12px; }
@media (max-width: 620px) {
  .api-reqs li { grid-template-columns: 52px minmax(0, 1fr); }
  .api-reqs code { grid-column: 1 / -1; }
}
.api-card { cursor: pointer; } .api-card code, .api-reqs { cursor: auto; }
