:root {
  --bg: #0b0d17; --card: #131728; --card2: #1a1f35; --line: #262c47;
  --text: #e9ecf8; --muted: #8b93b5; --accent: #7c5cff; --accent2: #22d3ee;
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171; --info: #60a5fa;
  --radius: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 420px at 10% -10%, rgba(124, 92, 255, .28), transparent 60%),
    radial-gradient(520px 420px at 105% 5%, rgba(34, 211, 238, .14), transparent 60%);
}
a { color: var(--accent2); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

header.top { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; gap: 12px; }
.logo { font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo small { font-weight: 600; font-size: 12px; color: var(--muted); margin-left: 6px; border: 1px solid var(--line); padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.top .link { color: var(--muted); text-decoration: none; font-size: 14px; }
.top .link:hover { color: var(--text); }

.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(28px, 6vw, 42px); line-height: 1.12; margin: 0 0 12px; letter-spacing: -.5px; }
.hero p { color: var(--muted); margin: 0; max-width: 580px; font-size: 16px; }

.tabs { display: flex; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 5px; margin: 24px 0 18px; }
.tab { flex: 1; border: 0; background: none; color: var(--muted); padding: 10px 6px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; transition: .15s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--card2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.panel { display: none; } .panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.field { display: block; margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.label em { font-style: normal; color: var(--muted); font-weight: 400; }
.hint { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }

input, textarea, select {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: inherit; font-size: 16px; outline: none; transition: border-color .15s;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
select { width: auto; padding: 8px 12px; font-size: 14px; cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 640px) { .types { grid-template-columns: repeat(2, 1fr); } }
.type { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; transition: .15s; }
.type input { position: absolute; opacity: 0; pointer-events: none; }
.type b { font-size: 14px; }
.type small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.type:hover { border-color: #3a4166; }
.type:has(input:checked) { border-color: var(--accent); background: rgba(124, 92, 255, .1); }
.type:has(input:focus-visible) { outline: 2px solid var(--accent2); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 22px; font: inherit; font-weight: 700; font-size: 15px; color: #fff; cursor: pointer; background: linear-gradient(90deg, var(--accent), #5b7cff); transition: transform .1s, opacity .15s; }
.btn:hover { opacity: .92; } .btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ghost { background: var(--card2); box-shadow: inset 0 0 0 1px var(--line); }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: rgba(248, 113, 113, .15); color: var(--bad); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.note { background: rgba(96, 165, 250, .08); border: 1px solid rgba(96, 165, 250, .25); border-radius: 12px; padding: 10px 14px; font-size: 14px; color: #c7d7f5; margin: 0 0 16px; }
.err { color: var(--bad); font-size: 14px; margin: 12px 0 0; }
.muted { color: var(--muted); }

.done { text-align: center; padding: 32px 20px; }
.done .icon { font-size: 44px; }
.done h2 { margin: 8px 0 6px; }
.code { display: inline-flex; align-items: center; gap: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: 1px; background: var(--bg); border: 1px dashed var(--accent); border-radius: 12px; padding: 10px 16px; margin: 14px 0; }

.toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.active { color: var(--text); border-color: var(--accent); background: rgba(124, 92, 255, .12); }

.list { display: grid; gap: 10px; }
.idea { display: flex; gap: 14px; align-items: flex-start; }
.vote { flex: none; display: flex; flex-direction: column; align-items: center; width: 54px; padding: 8px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; transition: .15s; }
.vote svg { width: 16px; height: 16px; }
.vote:hover { border-color: var(--accent); }
.vote.on { background: rgba(124, 92, 255, .18); border-color: var(--accent); color: #c9bcff; }
.idea-body { min-width: 0; flex: 1; }
.idea h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.35; }
.idea p { margin: 0; color: #c3c8de; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.idea p.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.reply { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--accent); background: rgba(124, 92, 255, .07); border-radius: 0 10px 10px 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply b { display: block; font-size: 12px; color: #b9a8ff; margin-bottom: 2px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; }
.s-new { color: var(--info); } .s-review { color: var(--warn); } .s-planned { color: #a78bfa; }
.s-done { color: var(--ok); } .s-declined { color: var(--bad); }
.tag { color: var(--muted); border-color: var(--line); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.my-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.my-item:first-child { border-top: 0; }
.my-item button { flex: none; }
.my-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

footer { padding: 40px 0 30px; color: var(--muted); font-size: 13px; text-align: center; }
footer a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--card2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
