/* Community Controller Mappings — studio UI. Matches the DJ Controllers modal (desktop.css .ctrl-*). */
.cm-modal, .cm-toast, .cm-hub, .cm-updates {
  --cm-gold: #c4a35a;
  --cm-ink: #f3ebe0;
  --cm-muted: rgba(243, 235, 224, 0.68);
  --cm-line: rgba(255, 255, 255, 0.12);
  --cm-card: rgba(255, 255, 255, 0.05);
  --cm-focus: #8ec8ff;
  --cm-bad: #ff9b8f;
  --cm-ok: #8fe3a7;
  color: var(--cm-ink);
}
/* `hidden` must win over the flex/grid display rules below (report forms, share options, viewers). */
.cm-modal [hidden], .cm-hub [hidden] { display: none !important; }
/* Above the DJ Controllers modal (.ctrl-modal, z-index 12000), which these open from. */
.cm-modal { position: fixed; inset: 0; z-index: 12150; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cm-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); }
.cm-modal__panel {
  position: relative; width: min(560px, 100%); max-height: min(88vh, 900px); overflow: auto;
  background: #17141a; border: 1px solid var(--cm-line); border-radius: 14px; padding: 16px 18px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.cm-modal__panel--wide { width: min(860px, 100%); }
.cm-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cm-modal__head h2 { font-size: 1.1rem; margin: 0; }
.cm-form, .cm-lib, .cm-mine, .cm-hub { display: flex; flex-direction: column; gap: 12px; }
.cm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cm-field { display: flex; flex-direction: column; gap: 4px; border: 0; padding: 0; margin: 0; min-width: 0; }
.cm-field > span, .cm-field > legend { font-size: 0.85rem; color: var(--cm-muted); }
.cm-field input[type="text"], .cm-field input:not([type]), .cm-field input[type="search"], .cm-field input[type="file"], .cm-field select, .cm-field textarea,
.cm-filters input, .cm-filters select {
  background: rgba(255, 255, 255, 0.06); color: var(--cm-ink); border: 1px solid var(--cm-line); border-radius: 8px; padding: 8px 10px; font: inherit; min-width: 0; width: 100%;
}
.cm-field input:focus, .cm-field select:focus, .cm-field textarea:focus, .cm-filters input:focus, .cm-filters select:focus,
.cm-modal button:focus-visible { outline: 2px solid var(--cm-focus); outline-offset: 2px; }
.cm-check, .cm-radio { display: flex; gap: 8px; align-items: flex-start; font-size: 0.92rem; }
.cm-radio { padding: 8px 10px; border: 1px solid var(--cm-line); border-radius: 10px; background: var(--cm-card); }
.cm-radio small, .cm-check small { display: block; color: var(--cm-muted); font-weight: normal; }
.cm-share { gap: 8px; }
.cm-shareopts { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-left: 3px solid var(--cm-gold); }
.cm-terms { padding: 10px; border: 1px dashed var(--cm-line); border-radius: 8px; font-size: 0.85rem; }
.cm-muted { color: var(--cm-muted); font-size: 0.88rem; margin: 0; }
.cm-note { background: rgba(196, 163, 90, 0.12); border: 1px solid rgba(196, 163, 90, 0.35); border-radius: 8px; padding: 8px 10px; margin: 0; font-size: 0.9rem; }
.cm-error { color: var(--cm-bad); margin: 0; font-size: 0.9rem; }
.cm-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cm-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cm-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cm-results > .cm-note { grid-column: 1 / -1; }
.cm-card { background: var(--cm-card); border: 1px solid var(--cm-line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.cm-card header { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.cm-card h4 { margin: 0; font-size: 1rem; flex: 1 1 100%; }
.cm-badge { display: inline-block; font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--cm-line); color: var(--cm-muted); }
.cm-badge--verified { color: var(--cm-ok); border-color: rgba(143, 227, 167, 0.5); }
.cm-badge--beta { color: var(--cm-gold); border-color: rgba(196, 163, 90, 0.6); }
.cm-badge--featured { color: #fff; background: rgba(196, 163, 90, 0.35); border-color: var(--cm-gold); }
.cm-badge--dep { color: var(--cm-bad); border-color: rgba(255, 155, 143, 0.5); }
.cm-meta { margin: 0; font-size: 0.85rem; color: var(--cm-muted); }
.cm-stars { color: var(--cm-gold); letter-spacing: 1px; }
.cm-stars--none { color: var(--cm-muted); letter-spacing: 0; }
.cm-star { background: none; border: 0; color: var(--cm-gold); font-size: 1.4rem; cursor: pointer; padding: 0 2px; }
.cm-list { margin: 4px 0 0 18px; padding: 0; font-size: 0.9rem; }
.cm-compare { display: grid; gap: 4px; font-size: 0.88rem; overflow-x: auto; }
.cm-compare__head, .cm-compare__row { display: grid; grid-template-columns: 2fr 1.3fr 1.2fr 0.7fr 0.7fr 0.7fr; gap: 8px; padding: 6px 8px; min-width: 560px; }
.cm-compare__head { color: var(--cm-muted); border-bottom: 1px solid var(--cm-line); }
.cm-compare__row { background: var(--cm-card); border-radius: 8px; }
.cm-tablewrap { overflow: auto; max-height: 50vh; border: 1px solid var(--cm-line); border-radius: 8px; }
.cm-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cm-table th, .cm-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--cm-line); }
.cm-table th { position: sticky; top: 0; background: #1d1a21; }
.cm-st-review td:last-child, .cm-st-partial td:last-child { color: var(--cm-gold); }
.cm-st-unsupported td:last-child { color: var(--cm-bad); }
.cm-st-direct td:last-child { color: var(--cm-ok); }
.cm-steps { display: grid; gap: 4px; }
.cm-step { display: grid; grid-template-columns: 1.4fr repeat(3, auto); gap: 10px; align-items: center; padding: 6px 8px; background: var(--cm-card); border-radius: 8px; font-size: 0.9rem; }
.cm-hub__nav { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-hub__nav .is-active { outline: 2px solid var(--cm-gold); }
.cm-updates { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cm-update { background: rgba(196, 163, 90, 0.12); border: 1px solid rgba(196, 163, 90, 0.4); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.cm-conflict { border: 1px solid var(--cm-line); border-radius: 10px; padding: 10px; margin: 8px 0; }
.cm-toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 12250; max-width: min(640px, calc(100vw - 24px));
  background: #211d26; border: 1px solid var(--cm-gold); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 0.92rem;
}
.cm-toast__actions { display: flex; gap: 4px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .cm-modal { padding: 0; align-items: flex-end; }
  .cm-modal__panel, .cm-modal__panel--wide { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .cm-row { grid-template-columns: 1fr; }
  .cm-step { grid-template-columns: 1fr 1fr; }
  .cm-step > span { grid-column: 1 / -1; }
  .cm-actions { justify-content: stretch; }
  .cm-actions > button { flex: 1 1 auto; }
}
