/* Ideas board: cabinet widget (assets/js/ideas.js) and the moderation tab of the admin panel
   (assets/js/admin-ideas.js). Colours come from the app.css tokens, so both themes work. */

.idea-card { margin-bottom: 16px; }
.idea-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.idea-top h3 { margin: 0 0 6px; }
.idea-lead { font-size: 13px; color: var(--text-secondary); line-height: 1.55; max-width: 640px; }
.idea-lead b { color: var(--text-main); }
.idea-wallet { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.idea-points { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent-warm-subtle); border: 1px solid color-mix(in srgb, var(--accent-warm) 35%, transparent); color: var(--accent-warm); font-weight: 700; font-variant-numeric: tabular-nums; }
.idea-points b { font-size: 18px; letter-spacing: -0.02em; }
.idea-points small { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.idea-next { font-size: 12px; color: var(--text-muted); }
.idea-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.idea-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg-subtle); border: 1px solid var(--border); overflow-x: auto; max-width: 100%; }
.idea-tabs button { border: 0; background: transparent; color: var(--text-secondary); font: 600 12.5px var(--font-sans); padding: 6px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.idea-tabs button.on { background: var(--bg-surface); color: var(--text-main); box-shadow: var(--shadow-sm); }
.idea-tabs .n { font: 700 10.5px var(--font-mono); color: var(--text-muted); }
.idea-tabs .dot { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent-red); color: #fff; font: 700 10px/16px var(--font-mono); text-align: center; }

.idea-list { display: grid; gap: 10px; }
.idea-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-surface); transition: border-color .15s ease; }
.idea-item:hover { border-color: var(--border-strong); }
.idea-item.fresh { border-color: color-mix(in srgb, var(--accent-warm) 55%, var(--border)); box-shadow: 0 0 0 3px var(--accent-warm-subtle); }
.idea-item.flash { animation: idea-flash 1.4s ease; }
@keyframes idea-flash { 0%, 40% { box-shadow: 0 0 0 4px var(--accent-violet-subtle); border-color: var(--border-focus); } }
.idea-title { font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--text-main); overflow-wrap: anywhere; }
.idea-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.idea-cat { padding: 2px 8px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 11.5px; }
.idea-body { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); white-space: pre-line; overflow-wrap: anywhere; }
.idea-body.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.idea-more { margin-top: 4px; border: 0; background: none; padding: 0; color: var(--accent-violet); font: 600 12.5px var(--font-sans); cursor: pointer; }
.idea-votes { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 92px; }
.idea-vote { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary); font: 700 13px var(--font-sans); font-variant-numeric: tabular-nums; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.idea-vote:hover:not(:disabled) { border-color: var(--border-strong); background: var(--bg-hover); color: var(--text-main); }
.idea-vote:disabled { cursor: default; opacity: .75; }
.idea-vote.up.mine { color: var(--accent-green); background: var(--accent-green-subtle); border-color: color-mix(in srgb, var(--accent-green) 40%, transparent); opacity: 1; }
.idea-vote.down.mine { color: var(--accent-red); background: var(--accent-red-subtle); border-color: color-mix(in srgb, var(--accent-red) 40%, transparent); opacity: 1; }
.idea-ratio { height: 4px; border-radius: 4px; background: var(--accent-red-subtle); overflow: hidden; }
.idea-ratio i { display: block; height: 100%; background: var(--accent-green); }
.idea-score { text-align: center; font: 600 11px var(--font-mono); color: var(--text-muted); }
.idea-state { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; background: var(--bg-subtle); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.idea-state.bad { background: var(--accent-red-subtle); border-color: color-mix(in srgb, var(--accent-red) 30%, transparent); }
.idea-state.ok { background: var(--accent-green-subtle); border-color: color-mix(in srgb, var(--accent-green) 30%, transparent); }
.idea-state b { color: var(--text-main); }
.idea-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13.5px; border: 1px dashed var(--border); border-radius: var(--radius-md); }
.idea-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.idea-foot details summary { cursor: pointer; color: var(--text-secondary); }
.idea-hist { display: grid; gap: 4px; margin-top: 8px; font-size: 12.5px; }
.idea-hist div { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; }
.idea-hist .p { font: 700 12px var(--font-mono); text-align: right; }
.idea-hist .p.plus { color: var(--accent-green); }
.idea-hist .p.minus { color: var(--accent-red); }
.idea-hist .w { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }

/* submit form (modal) */
.idea-modal { max-width: 640px; }
.idea-modal .modal-body { display: grid; gap: 14px; max-height: min(720px, calc(90vh - 140px)); overflow-y: auto; }
.idea-field label { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.idea-field label .cnt { font: 500 11.5px var(--font-mono); color: var(--text-muted); }
.idea-field label .cnt.bad { color: var(--accent-red); }
.idea-field .input, .idea-field .select, .idea-field .textarea { width: 100%; }
.idea-field .textarea { min-height: 130px; }
.idea-field.err .input, .idea-field.err .textarea { border-color: var(--accent-red); }
.idea-cost { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-warm-subtle); font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.idea-cost b { color: var(--text-main); }
.idea-similar { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-subtle); font-size: 12.5px; }
.idea-similar b { display: block; margin-bottom: 6px; color: var(--text-main); }
.idea-similar button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 4px 0; color: var(--accent-violet); font: 500 13px var(--font-sans); cursor: pointer; }
.idea-rules { font-size: 12.5px; color: var(--text-secondary); }
.idea-rules summary { cursor: pointer; font-weight: 600; color: var(--text-main); }
.idea-rules ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.idea-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-red-subtle); color: var(--accent-red); font-size: 13px; line-height: 1.5; }
.idea-done { text-align: center; padding: 26px 10px 10px; }
.idea-done .big { font-size: 44px; line-height: 1; }
.idea-done h4 { margin: 14px 0 8px; font-size: 18px; }
.idea-done p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; max-width: 440px; margin: 0 auto; }

@media (max-width: 640px) {
  .idea-item { grid-template-columns: minmax(0, 1fr); }
  .idea-votes { flex-direction: row; min-width: 0; }
  .idea-votes .idea-vote { flex: 1; }
  .idea-votes .idea-ratio, .idea-votes .idea-score { display: none; }
  .idea-top .btn { width: 100%; }
}

/* ideas.html: sign in with the key */
.idea-login { display: grid; gap: 6px; flex: 0 1 460px; min-width: min(100%, 300px); }
.idea-login .input { height: 40px; }
.idea-next.bad { color: var(--accent-red); }
.ideas-steps { margin-top: 10px; }

/* admin: moderation cards */
.mod-list { display: grid; gap: 12px; }
.mod-item { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); padding: 16px; }
.mod-item .hd { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.mod-item h4 { margin: 0; font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; }
.mod-who { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.mod-who b { color: var(--text-main); cursor: pointer; }
.mod-body { margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); white-space: pre-line; overflow-wrap: anywhere; }
.mod-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mod-flags span { padding: 3px 9px; border-radius: 999px; font-size: 12px; background: var(--accent-warm-subtle); color: var(--accent-warm); }
.mod-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mod-reason { margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-red-subtle); font-size: 13px; }
.mod-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mod-tpl { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; line-height: 1.3; }
.mod-tpl:hover { border-color: var(--border-strong); }
.mod-tpl input { margin: 0; flex: 0 0 auto; }
.mod-tpl .r { margin-left: auto; white-space: nowrap; font: 600 10.5px var(--font-mono); }
.mod-tpl .r.yes { color: var(--accent-green); }
.mod-tpl .r.no { color: var(--accent-red); }
.mod-scroll { max-height: calc(100vh - 10vh - 150px); overflow-y: auto; }
@media (max-width: 560px) { .mod-tpls { grid-template-columns: minmax(0, 1fr); } }
.mod-tpl:has(input:checked) { border-color: var(--border-focus); background: var(--accent-violet-subtle); }
