/*
 * @file portal-dev.css
 * @description "For Developers" portal view styles (.dv-* prefix) — animated
 *   background layers, onboarding steps, platform/goal cards, prompt output,
 *   capability tabs. Consumes theme.css tokens so it flips with dark/light.
 * @version-history
 *   v1.1.0 — 2026-06-02 — Phase 4: tokenize card/panel/border/text/bg-layer/code
 *     surfaces (#FFFFFF/#E5E7EB/#F3F4F6/#6B7280) for dark mode.
 *   v1.2.0 — 2026-06-02 — Component unification (#6 stat cards): remove .dv-stat* /
 *     .dv-num / .dv-label; dev-portal stats use canonical .stat-card family.
 *   v1.3.0 — 2026-06-02 — Component unification (#11): remove .dv-dot (had a
 *     hardcoded #22c55e); node-badge dot uses canonical <StatusDot>.
 *   v1.4.0 — 2026-07-28 — Community list leads with Open (apps run on the node) and keeps
 *     Download as the quieter second action: .dv-app-actions / -open / -download.
 *   v1.5.0 — 2026-08-08 — The copy button is the shared .btn-primary; .dv-copy-btn / .dv-copy-btn--alt are gone,
 *       along with the two conflicting .dv-copy-btn definitions that fought over it. The corner
 *       positioning moved onto .dv-prompt-output, the container that actually owns it.
 *   v1.6.0 — 2026-08-08 — Close the header comment. The v1.2.0 entry above wrote ".dv-stat*/" —
 *       that "*/" TERMINATED this comment at line 9, so from 2026-06-02 the rest of the header
 *       was parsed as CSS. The parser consumed it as one long selector up to the next "{",
 *       which swallowed the whole `:root { --love1..5 }` block below: browser-verified, the
 *       sheet's first parsed rule was .dv-bg-layer and --love2 resolved to theme.css's #FF6B6B
 *       instead of the #D44A3F declared here. Now restored (139 rules, :root first). NOTE the
 *       block is UNSCOPED and this sheet is linked globally in spa.html, so it wins over
 *       theme.css app-wide — --love2/3/4/5 change everywhere, including two profile.css text
 *       colours (.dw-code-accent, .access-mcp-url via --love3). --love* are theme-invariant
 *       (theme.css:128), so light and dark resolve identically; verified both.
 */
/* ── Dev Portal root vars ── */
:root {
  --love1: #E8564A;
  --love2: #D44A3F;
  --love3: #F06B5E;
  --love4: #E8564A;
  --love5: #B8403A;
}

/* ── Background system ── */
.dv-bg-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; transition: opacity .8s ease; }
.dv-bg-hidden { opacity: 0; }
.dv-bg-hearts { background: var(--bg); }
.dv-heart-particle { position: absolute; bottom: -60px; opacity: 0; font-size: 1.2rem; animation: dv-floatUp linear infinite; filter: drop-shadow(0 0 6px rgba(232,86,74,.2)); }
@keyframes dv-floatUp { 0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0; } 10% { opacity: .7; } 90% { opacity: .7; } 100% { transform: translateY(-110vh) rotate(720deg) scale(.3); opacity: 0; } }
.dv-bg-aurora { background: var(--bg); }
.dv-aurora-wave { position: absolute; width: 200%; height: 60%; left: -50%; border-radius: 50%; filter: blur(80px); opacity: .12; animation: dv-auroraShift 8s ease-in-out infinite alternate; }
.dv-aurora-wave:nth-child(1) { top: 10%; background: linear-gradient(90deg, #E8564A, #D44A3F, #F06B5E, #E8564A); animation-duration: 8s; }
.dv-aurora-wave:nth-child(2) { top: 30%; background: linear-gradient(90deg, #E8564A, #B8403A, #E8564A, #D44A3F); animation-duration: 12s; animation-delay: -4s; }
.dv-aurora-wave:nth-child(3) { top: 55%; background: linear-gradient(90deg, #D44A3F, #E8564A, #F06B5E, #B8403A); animation-duration: 10s; animation-delay: -2s; }
@keyframes dv-auroraShift { 0% { transform: translateX(-20%) scaleY(1); } 50% { transform: translateX(10%) scaleY(1.3); } 100% { transform: translateX(-10%) scaleY(.8); } }
.dv-bg-sparkle { background: var(--bg); }
.dv-sparkle { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #E8564A; animation: dv-sparkleAnim ease-in-out infinite; }
@keyframes dv-sparkleAnim { 0%, 100% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px 2px var(--love1), 0 0 20px 4px var(--love4); } }
.dv-nebula-blob { position: absolute; border-radius: 50%; filter: blur(100px); opacity: .08; animation: dv-nebulaFloat 15s ease-in-out infinite alternate; }
@keyframes dv-nebulaFloat { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(40px,-30px) scale(1.2); } }

/* BG selector */
.dv-bg-selector { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200; display: flex; gap: .5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 30px; padding: .4rem .6rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.dv-bg-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: all .25s; display: flex; align-items: center; justify-content: center; font-size: .9rem; background: var(--bg-surface); }
.dv-bg-btn:hover { border-color: var(--love1); transform: scale(1.15); }
.dv-bg-btn.active { border-color: var(--love1); box-shadow: 0 0 12px rgba(232,86,74,.2); }

/* Container */
.dv-container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; position: relative; z-index: 1; }
.dv-container h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: .5rem; }
.dv-container h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: .75rem; color: var(--love1); }
.dv-container h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.dv-subtitle { color: var(--love4, #E8564A); font-size: .95rem; margin-bottom: 2rem; }
.dv-node-badge { display: inline-flex; align-items: center; gap: .5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .8rem; font-size: .85rem; font-family: monospace; margin-bottom: 1.5rem; }
/* .dv-dot removed — node-badge dot uses canonical <StatusDot>. Unified 2026-06-02 (#11). */
.dv-repos { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.dv-repo-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--text); text-decoration: none; font-size: .85rem; border: 1px solid var(--border); border-radius: 8px; padding: .4rem .8rem; background: var(--bg-card); }
.dv-repo-link:hover { color: var(--love4, #E8564A); border-color: var(--love4, #E8564A); }
.dv-repo-link .gh-mark { flex: none; }

/* Stats — .dv-stat*/.dv-num/.dv-label removed; dev-portal stats use canonical
   .stat-grid / .stat-card / .stat-card-value.accent / .stat-card-label. Unified 2026-06-02 (#6). */

/* Mode notice */
.dv-mode-notice { border-radius: 12px; padding: 1rem 1.5rem; margin-bottom: 1.5rem; font-size: .9rem; display: flex; align-items: flex-start; gap: .75rem; }
.dv-mode-notice-anon { background: var(--purple-bg); border: 1px solid var(--purple-border); }
.dv-mode-notice-user { background: var(--success-bg); border: 1px solid var(--success-border); }
.dv-notice-icon { font-size: 1.3rem; flex-shrink: 0; }

/* Steps */
.dv-step { margin-bottom: 2rem; }
.dv-step-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.dv-step-num { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--love1), var(--love2)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; flex-shrink: 0; box-shadow: 0 2px 8px rgba(232,86,74,.15); }
.dv-step-num.done { background: linear-gradient(135deg, #22c55e, #16a34a); }
.dv-step-label { font-size: 1.1rem; font-weight: 600; }

/* Platform grid */
.dv-platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.dv-platform-card { background: var(--bg-card); border: 2px solid var(--border); border-radius: 12px; padding: 1rem; text-align: center; cursor: pointer; transition: all .15s; }
.dv-platform-card:hover { border-color: var(--love1); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(232,86,74,.08); }
.dv-platform-card.selected { border-color: var(--love1); background: rgba(232,86,74,.06); box-shadow: 0 0 20px rgba(232,86,74,.1); }
.dv-platform-name { font-weight: 600; font-size: .9rem; }
.dv-platform-vendor { color: var(--text-dim); font-size: .75rem; }

/* Variants */
.dv-variants { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.dv-variant-btn { background: var(--bg-card); border: 2px solid var(--border); border-radius: 8px; padding: .4rem .8rem; cursor: pointer; color: var(--text, #1A1A2E); font-size: .85rem; transition: all .15s; font-family: inherit; }
.dv-variant-btn:hover { border-color: var(--love1); }
.dv-variant-btn.selected { border-color: var(--love1); background: rgba(232,86,74,.06); }
.dv-variant-note { font-size: .8rem; color: var(--text-dim); margin-top: .25rem; }

/* Panel */
.dv-panel { background: var(--bg-card); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid var(--border); }
.dv-panel--accent { border-color: var(--love1, #E8564A); }
.dv-panel-title { margin: 0 0 .5rem; }
.dv-panel-lead { margin: 0 0 .5rem; }
.dv-notice-sub { color: var(--text-dim); font-size: .85rem; }
.dv-mt { margin-top: 1.25rem; }
.dv-prompt-output--flush { margin-bottom: 0; }
.dv-prompt-text--single { max-height: none; font-size: .85rem; }

/* Prompt output */
.dv-prompt-output { position: relative; }
.dv-prompt-text { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; font-family: monospace; font-size: .8rem; white-space: pre-wrap; word-break: break-word; max-height: 500px; overflow-y: auto; line-height: 1.5; color: var(--text, #1A1A2E); }
/* The prompt box's copy button overlays the top-right corner of the scrollable text. The
   POSITION belongs to this container (which is position:relative) — the button itself is a
   plain shared .btn-primary, and its green confirmed state comes from theme.css. */
.dv-prompt-output > .btn-primary { position: absolute; top: .5rem; right: .5rem; z-index: 1; }

/* Goals */
.dv-goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.dv-goal-card { background: var(--bg-card); border: 2px solid var(--border); border-radius: 8px; padding: .75rem; cursor: pointer; transition: all .15s; font-size: .85rem; }
.dv-goal-card:hover { border-color: var(--love1); }
.dv-goal-card.selected { border-color: var(--love1); background: rgba(232,86,74,.06); }
.dv-goal-icon { font-size: 1.3rem; margin-bottom: .25rem; }

/* Cap tabs */
.dv-cap-tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 2px solid var(--border); }
.dv-cap-tab { flex: 1; padding: .75rem 1rem; text-align: center; cursor: pointer; background: transparent; border: none; color: var(--text-dim); font-size: .9rem; font-weight: 600; transition: all .2s; border-bottom: 3px solid transparent; margin-bottom: -2px; position: relative; font-family: inherit; }
.dv-cap-tab:hover { color: var(--text, #1A1A2E); background: rgba(232,86,74,.04); }
.dv-cap-tab.active { color: var(--love1); border-bottom-color: var(--love1); background: rgba(232,86,74,.06); }
.dv-cap-tab.unavail { opacity: .45; cursor: default; }
.dv-cap-tab.unavail:hover { background: transparent; color: var(--text-dim); }
.dv-tab-icon { font-size: 1.2rem; display: block; margin-bottom: .15rem; }
.dv-tab-label { font-size: .8rem; display: block; }
.dv-tab-rec { position: absolute; top: 2px; right: 6px; font-size: .55rem; background: #22c55e; color: #fff; padding: 1px 5px; border-radius: 8px; text-transform: uppercase; letter-spacing: .05em; }
.dv-unavail-notice { text-align: center; padding: 2rem 1rem; color: var(--text-dim); font-size: .9rem; }
.dv-unavail-icon { font-size: 2rem; margin-bottom: .5rem; }

/* Instructions */
.dv-instructions { background: var(--bg-card); border-radius: 12px; padding: 1.5rem; border: 1px solid var(--border); }
.dv-instructions ol { margin-left: 1.5rem; margin-bottom: .75rem; }
.dv-instructions li { margin-bottom: .5rem; }
.dv-instructions code { background: var(--code-bg); padding: .15rem .4rem; border-radius: 4px; font-size: .85rem; font-family: monospace; }

/* Upload */
.dv-upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 1.5rem; text-align: center; margin-top: 1rem; transition: all .2s; }
.dv-upload-area:hover { border-color: var(--love1); }
.dv-upload-area.dragover { border-color: var(--love1); background: rgba(232,86,74,.04); }
.dv-upload-btn { background: linear-gradient(135deg, var(--love1), var(--love2)); color: #fff; border: none; border-radius: 8px; padding: .5rem 1.2rem; cursor: pointer; font-weight: 600; font-size: .9rem; transition: all .2s; font-family: inherit; }
.dv-upload-btn:hover { background: linear-gradient(135deg, var(--love3), var(--love1)); box-shadow: 0 2px 16px rgba(232,86,74,.2); }
.dv-upload-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Share URL */
.dv-share-url { display: flex; align-items: center; gap: .5rem; background: var(--bg-surface); border: 1px solid var(--success); border-radius: 8px; padding: .6rem 1rem; margin-top: .75rem; font-family: monospace; font-size: .85rem; }
.dv-share-url input { flex: 1; background: none; border: none; color: var(--text, #1A1A2E); font-family: monospace; font-size: .85rem; outline: none; }
/* The share-url row's copy button confirms success by existing next to a live URL, so it is
   styled as the success action rather than the accent one. */
.dv-share-url .btn-primary { background: #22c55e; box-shadow: none; }

/* App list */
.dv-app-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .75rem; margin-top: 1rem; }
.dv-app-item { background: var(--bg-card); border-radius: 8px; padding: 1rem; border: 1px solid var(--border); }
.dv-app-name { font-weight: 600; margin-bottom: .25rem; }
.dv-app-meta { font-size: .75rem; color: var(--text-dim); }
.dv-app-item a { color: var(--love1, #E8564A); }
/* Open first: these apps run on the node, they are not files you take home.
   Download stays available as the quieter second action. */
.dv-app-actions { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
.dv-app-open { font-size: .8rem; padding: .3rem .8rem; }
.dv-app-download { font-size: .78rem; color: var(--text-dim); }
.dv-app-item .dv-app-download { color: var(--text-dim); }

@media (max-width: 600px) {
  .dv-platforms { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .dv-goals { grid-template-columns: 1fr; }
  .dv-stats { flex-direction: column; }
  .dv-container h1 { font-size: 1.4rem; }
}

/* ── MCP setup panel: lifted out of ~52 inline styles + a tabStyle() inline-CSS
   builder + a bespoke non-brand purple/rgba(255,255,255) palette (portal-dev.panels.js).
   All colours are theme tokens now (purple/info/success/warn tints), so the panel
   flips correctly in dark mode. ── */
.dv-callout { border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.dv-callout--warn { background: var(--warn-bg); border: 1px solid var(--warn-border); }
.dv-callout--success { background: var(--success-bg); border: 1px solid var(--success-border); }
.dv-callout--purple { background: var(--purple-bg); border: 1px solid var(--purple-border); }
.dv-info-box { margin-top: .75rem; padding: .5rem .75rem; background: var(--info-bg); border: 1px solid var(--info-border); border-radius: .25rem; font-size: .82rem; }
.dv-setup-tabs { display: flex; gap: 2px; margin-top: .75rem; border-bottom: 1px solid var(--purple-border); }
.dv-setup-tab { padding: .4rem .75rem; border: none; border-radius: .25rem .25rem 0 0; cursor: pointer; font-size: .8rem; font-weight: 600; background: transparent; color: var(--text-dim); }
.dv-setup-tab.active { background: var(--purple-bg); color: var(--purple-fg); }
.dv-tab-content { padding: .75rem 0 0; }
.dv-panel-desc { font-size: .82rem; color: var(--text-dim); margin: 0 0 .75rem; }
.dv-field { margin-bottom: .75rem; }
.dv-field-label { font-size: .8rem; color: var(--text-dim); margin-bottom: .25rem; }
.dv-code-row { display: flex; align-items: center; gap: .5rem; }
.dv-code { font-size: .78rem; background: var(--code-bg); padding: .4rem .6rem; border-radius: .25rem; user-select: all; flex: 1; word-break: break-all; }
.dv-code--inline { font-size: .78rem; background: var(--code-bg); padding: .25rem .5rem; border-radius: .25rem; user-select: all; }
.dv-code--inline-sm { font-size: .8rem; background: var(--code-bg); padding: .25rem .5rem; border-radius: .25rem; user-select: all; }
.dv-note { margin-top: .75rem; font-size: .8rem; color: var(--text-dim); font-style: italic; }
.dv-inline-link { color: var(--accent); font-style: normal; font-weight: 600; }
.dv-hint { font-size: .8rem; color: var(--text-dim); margin: 0; font-style: italic; }
.dv-step-img { max-width: 100%; border-radius: .5rem; border: 1px solid var(--border); }
.dv-step-media { margin: .5rem 0; }
.dv-steps { margin: 0; padding-left: 1.25rem; line-height: 1.8; }
.dv-steps--tight { line-height: 1.6; }
.dv-step-row { display: flex; align-items: center; gap: .5rem; margin: .4rem 0; }
.dv-block-sm { font-size: .85rem; }
.dv-p-mt { margin: .5rem 0 0; font-size: .85rem; }
.dv-p-mt-muted { margin: .5rem 0 0; font-size: .85rem; color: var(--text-dim); }
.dv-p-mt-lg { margin: .5rem 0 0; font-size: .9rem; }
.dv-details { margin-top: .75rem; font-size: .85rem; }
.dv-details-summary { cursor: pointer; color: var(--text-dim); }
.dv-details-body { margin-top: .5rem; padding: .5rem; background: var(--bg-surface); border-radius: .25rem; }
.dv-mt { margin-top: 1rem; }
.dv-ul-indent { margin-left: 1.5rem; }
.dv-link { color: var(--accent); text-decoration: underline; }
.dv-ok-line { color: var(--success); font-size: .85rem; }
.dv-muted-line { color: var(--text-dim); font-size: .85rem; }
.dv-p-desc-muted { margin: 0 0 .75rem; color: var(--text-dim); }
.dv-unavail-sub { font-size: .8rem; margin-top: .5rem; }
.dv-mt-sm { margin-top: .5rem; font-size: .85rem; }
