/* ============================================================
   AIbrain71 – Ideen-Portal · Design-System
   ============================================================ */

:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #6b7280;
  --line: #e6e8f2;
  --line-2: #eef0f7;

  --primary: #5b5bf0;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #ef4444;

  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, #eef1ff 0%, #f5eeff 50%, #eafaff 100%);
  --dark: #0b1020;
  --dark-2: #0e1530;

  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow: 0 4px 14px rgba(15,23,42,.08);
  --shadow-lg: 0 18px 50px rgba(31,38,90,.18);
  --shadow-glow: 0 20px 60px rgba(99,102,241,.35);

  --maxw: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1rem; }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.sep { opacity: .5; margin: 0 .15rem; }
.center { text-align: center; }
.inline { display: inline; }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--primary-600);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .7rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary-600); color: #fff; box-shadow: 0 6px 18px rgba(79,70,229,.3); }
.btn-primary:hover { background: var(--primary-700); box-shadow: 0 10px 26px rgba(79,70,229,.42); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: #c9cdee; box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: rgba(99,102,241,.08); color: var(--primary-700); }
.btn-sm { padding: .5rem .85rem; font-size: .86rem; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; }
.brand-name { letter-spacing: -.02em; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff; font-weight: 900; font-size: .82rem;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}
.brand-mark.sm { width: 24px; height: 24px; border-radius: 7px; font-size: .62rem; }
.brand-mark.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.3rem; margin-bottom: .5rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.nav-links { display: flex; gap: .35rem; margin-left: .5rem; flex: 1; }
.nav-links a { padding: .5rem .8rem; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: .94rem; }
.nav-links a:hover { background: var(--line-2); color: var(--ink); }
.nav-links a.active { color: var(--primary-700); background: rgba(99,102,241,.1); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.user-chip { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; font-weight: 500; color: var(--ink-2); }
.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: .72rem; font-weight: 700; flex: none;
}
.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--ink); }
.admin-header { background: #0e1530; border-bottom-color: #1e2747; }
.admin-header .brand-name, .admin-header .nav-links a { color: #c7cdf2; }
.admin-header .nav-links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-header .nav-links a.active { background: rgba(99,102,241,.25); color: #fff; }
.admin-header .user-chip { color: #aab2dd; }
.admin-tag { font-size: .6rem; background: var(--primary); color: #fff; padding: .12rem .4rem; border-radius: 5px; vertical-align: middle; font-weight: 700; }

/* ---------- Hero ---------- */
.appbar-banner { background: var(--grad); color: #fff; font-size: .92rem; }
.appbar-banner .container { padding-top: .7rem; padding-bottom: .7rem; }
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 75% -10%, #eef0ff 0, transparent 60%), var(--bg); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; padding: 5rem 24px 4.5rem; }
.hero-title { font-size: clamp(2.3rem, 1.3rem + 3.4vw, 3.7rem); font-weight: 900; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.12rem; color: var(--ink-2); max-width: 33em; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.6rem 0 1rem; }
.hero-cta.center { justify-content: center; }
.hero-meta { display: flex; gap: .4rem; align-items: center; font-size: .86rem; color: var(--muted); flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 600;
  padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); margin-bottom: 1.2rem; box-shadow: var(--shadow-sm);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.pill-glow { background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.25); color: var(--primary-700); }
.hero-visual { position: relative; }
.hero-glow { position: absolute; inset: 10% -10% -10% 10%; background: var(--grad); filter: blur(80px); opacity: .25; z-index: -1; border-radius: 50%; }

/* ---------- TV mockup + drift ---------- */
.tv { perspective: 1200px; }
.tv-screen {
  position: relative; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden;
  background: #05060c; border: 10px solid #0c0e16;
  box-shadow: var(--shadow-lg), inset 0 0 60px rgba(0,0,0,.6);
}
.tv-screen img { width: 100%; height: 100%; object-fit: cover; }
.tv-stand { width: 26%; height: 14px; margin: 0 auto; background: linear-gradient(#161a26, #0c0e16); border-radius: 0 0 10px 10px; }
.tv-stand::after { content: ""; display: block; width: 160%; height: 8px; margin: 6px -30% 0; background: #0c0e16; border-radius: 6px; }
.drift { position: absolute; inset: 0; background: radial-gradient(120% 120% at 30% 20%, #1d2550 0, #0a0c1a 70%); }
.drift .cover {
  position: absolute; width: 30%; aspect-ratio: 1; border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0,0,0,.55); opacity: .92;
  animation: drift 14s ease-in-out infinite;
}
.drift .c1 { left: 6%;  top: 16%; background: linear-gradient(135deg,#fb7185,#f43f5e); animation-delay: 0s; }
.drift .c2 { left: 38%; top: 8%;  background: linear-gradient(135deg,#6366f1,#22d3ee); animation-delay: -2s; width: 26%; }
.drift .c3 { left: 66%; top: 22%; background: linear-gradient(135deg,#a855f7,#6366f1); animation-delay: -5s; }
.drift .c4 { left: 14%; top: 52%; background: linear-gradient(135deg,#10b981,#22d3ee); animation-delay: -7s; width: 24%; }
.drift .c5 { left: 44%; top: 46%; background: linear-gradient(135deg,#f59e0b,#f97316); animation-delay: -3.5s; }
.drift .c6 { left: 70%; top: 56%; background: linear-gradient(135deg,#ec4899,#8b5cf6); animation-delay: -9s; width: 22%; }
.drift .c7 { left: 26%; top: 30%; background: linear-gradient(135deg,#38bdf8,#818cf8); animation-delay: -11s; width: 20%; opacity: .8; }
@keyframes drift {
  0%,100% { transform: translate(0,0) rotate(-2deg); }
  50% { transform: translate(6px,-14px) rotate(2deg); }
}
.drift-label {
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .5rem; color: #fff; font-weight: 800;
  letter-spacing: .02em; font-size: 1.1rem; background: rgba(8,10,20,.55);
  padding: .5rem 1rem; border-radius: 999px; backdrop-filter: blur(6px);
}
@media (prefers-reduced-motion: reduce) { .drift .cover { animation: none; } }

/* ---------- Stat strip ---------- */
.stat-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); }
.stat { text-align: center; padding: 1.8rem 1rem; border-left: 1px solid var(--line-2); }
.stat:first-child { border-left: 0; }
.stat-num { display: block; font-size: 2rem; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 500; }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section-alt { background: var(--grad-soft); }
.section-dark { background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%); color: #e6e9f7; }
.section-head { margin-bottom: 2.5rem; }
.section-head.center { text-align: center; max-width: 720px; margin-inline: auto; }
.section-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--primary-600); margin-bottom: .6rem; }
.eyebrow.light { color: var(--cyan); }
.lead { font-size: 1.1rem; color: var(--ink-2); }
.lead-light { font-size: 1.1rem; color: #b9c0e6; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.8rem; box-shadow: var(--shadow-sm); position: relative; }
.step-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 900; display: grid; place-items: center; margin-bottom: 1rem; box-shadow: 0 6px 16px rgba(99,102,241,.35); }
.step h3 { font-size: 1.2rem; }
.step p { margin: 0; color: var(--ink-2); }

/* feature */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.check-list { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; gap: .8rem; }
.check-list li { display: flex; gap: .7rem; align-items: flex-start; font-weight: 500; }
.check { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(16,185,129,.15); color: var(--emerald); font-weight: 800; flex: none; font-size: .8rem; }
.feature-note { font-size: .82rem; margin-top: 1rem; }
.feature-note code, .prose code { background: #eef0f7; padding: .1rem .4rem; border-radius: 6px; font-size: .85em; }

/* idea preview grid */
.idea-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; }
.idea-card-mini { display: flex; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .2s, border-color .2s; }
.idea-card-mini:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d6d9f0; }
.idea-mini-body h3 { font-size: 1rem; margin: .3rem 0; }
.idea-mini-body p { margin: 0; font-size: .86rem; }
.idea-mini-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.votepill { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 50px; height: fit-content; padding: .5rem; border: 1px solid var(--line); border-radius: 10px; font-weight: 800; color: var(--ink-2); }
.votepill.voted { border-color: var(--primary); color: var(--primary-700); background: rgba(99,102,241,.08); }
.votepill .caret { font-size: .7rem; }

/* ---------- AI section (dark) ---------- */
.ai-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.ai-points { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.6rem; }
.ai-point { display: flex; gap: .7rem; align-items: flex-start; }
.ai-ico { font-size: 1.3rem; }
.ai-point strong { display: block; font-size: .95rem; }
.ai-point span { color: #aab2dd; font-size: .85rem; }
.ai-visual { display: grid; place-items: center; }
.ai-card { width: 100%; max-width: 360px; background: linear-gradient(160deg, #141b3a, #0e1530); border: 1px solid #273258; border-radius: var(--r-lg); padding: 1.4rem; box-shadow: var(--shadow-lg); }
.ai-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.ai-chip { background: var(--grad); color: #fff; font-size: .74rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; }
.muted-light { color: #7c86b8; font-size: .8rem; }
.ai-row { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid #222c4f; font-size: .92rem; }
.ai-row span { color: #9aa3d0; }
.ai-row strong { color: #fff; }
.ai-bar { height: 8px; background: #222c4f; border-radius: 999px; margin: 1rem 0; overflow: hidden; }
.ai-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald), var(--cyan)); border-radius: 999px; }
.ai-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.ai-tags span { background: rgba(99,102,241,.18); color: #c7cdf6; font-size: .76rem; padding: .25rem .6rem; border-radius: 999px; }
.section-dark h2 { color: #fff; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--grad); color: #fff; }
.cta-inner { text-align: center; padding: 4rem 24px; }
.cta-inner h2 { color: #fff; }
.cta-inner p { color: rgba(255,255,255,.85); font-size: 1.1rem; }
.cta-band .btn-primary { background: #fff; color: var(--primary-700); }
.cta-band .btn-primary:hover { background: #f1f1ff; }
.cta-band .btn-secondary { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }

/* ---------- Footer ---------- */
.site-footer { background: #0b1020; color: #aab2dd; padding: 3rem 0 1.5rem; margin-top: 4rem; }
.section-dark + .cta-band + .site-footer, .cta-band + .site-footer { margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer .brand-name { color: #fff; }
.footer-col h4 { color: #fff; font-size: .9rem; margin-bottom: .8rem; }
.footer-col a, .footer-brand a { display: block; color: #9aa3d0; padding: .25rem 0; font-size: .92rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #1c2342; font-size: .84rem; flex-wrap: wrap; gap: .5rem; }
.badge-ai { font-size: .76rem; padding: .3rem .7rem; border-radius: 999px; font-weight: 600; }
.badge-ai.on { background: rgba(16,185,129,.18); color: #6ee7b7; }
.badge-ai.off { background: rgba(245,158,11,.16); color: #fcd34d; }

/* ============================================================
   App pages (board, detail, forms, admin)
   ============================================================ */
.page { padding: 2.2rem 24px 4rem; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .2rem; }
.page-head p { margin: 0; }
.back-link { display: inline-block; color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.back-link:hover { color: var(--primary-700); }

/* badges & chips */
.status-badge { display: inline-flex; align-items: center; font-size: .76rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); }
.status-badge.lg { font-size: .9rem; padding: .4rem 1rem; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: .35rem; }
.tag-type { font-size: .76rem; font-weight: 700; padding: .25rem .55rem; border-radius: 8px; background: #eef0f7; color: var(--ink-2); }
.tag-type.problem { background: rgba(239,68,68,.1); color: #b91c1c; }
.tag-type.idea { background: rgba(99,102,241,.1); color: var(--primary-700); }
.chip { font-size: .76rem; padding: .25rem .6rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
a.chip:hover, .chip.active { border-color: var(--primary); color: var(--primary-700); background: rgba(99,102,241,.08); }
.pill-official { font-size: .68rem; font-weight: 800; background: var(--grad); color: #fff; padding: .12rem .5rem; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Board layout ---------- */
.board { display: grid; grid-template-columns: 250px 1fr; gap: 1.8rem; align-items: start; }
.board-side { position: sticky; top: 84px; }
.filter-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; box-shadow: var(--shadow-sm); }
.filter-search input { width: 100%; }
.filter-block { margin-top: 1.1rem; }
.filter-block h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .55rem; }
.radio { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .9rem; cursor: pointer; color: var(--ink-2); }
.radio input { accent-color: var(--primary); }
.radio .count { margin-left: auto; font-size: .78rem; color: var(--muted); background: var(--line-2); padding: .05rem .45rem; border-radius: 999px; }

.board-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.sort-tabs { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .25rem; gap: .15rem; }
.sort-tab { padding: .4rem .85rem; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.sort-tab:hover { background: var(--line-2); }
.sort-tab.active { background: var(--ink); color: #fff; }
.result-count { font-size: .86rem; }

/* idea list */
.idea-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.idea-row { display: flex; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s, transform .12s; }
.idea-row:hover { box-shadow: var(--shadow); border-color: #d8dbf0; transform: translateY(-1px); }
.votebtn {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; min-width: 58px;
  padding: .55rem; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; font: inherit; font-weight: 800; color: var(--ink-2); transition: all .15s;
}
.votebtn:hover { border-color: var(--primary); color: var(--primary-700); background: rgba(99,102,241,.06); }
.votebtn.voted { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(91,91,240,.35); }
.votebtn .caret { font-size: .8rem; line-height: 1; }
.votebtn .vcount { font-size: 1.1rem; }
.votebtn.lg { flex-direction: row; min-width: auto; padding: .7rem 1.3rem; gap: .6rem; font-size: 1rem; }
.votebtn.lg .vcount { font-size: 1.3rem; }
.votebtn.lg .vlabel { font-weight: 600; font-size: .9rem; }
.idea-row-body { flex: 1; min-width: 0; }
.idea-row-meta { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.idea-row-title { font-size: 1.12rem; margin: 0 0 .25rem; }
.idea-row:hover .idea-row-title { color: var(--primary-700); }
.idea-row-desc { margin: 0 0 .5rem; color: var(--ink-2); font-size: .92rem; }
.idea-row-foot { font-size: .82rem; display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }

/* ---------- Idea detail ---------- */
.idea-detail { display: grid; grid-template-columns: 1fr 300px; gap: 2.2rem; align-items: start; }
.idea-main { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2rem; box-shadow: var(--shadow-sm); }
.idea-title { margin: .6rem 0 .3rem; }
.idea-byline { font-size: .9rem; margin-bottom: 1.4rem; }
.idea-vote-cta { display: flex; align-items: center; gap: 1.1rem; padding: 1.1rem; background: var(--grad-soft); border-radius: var(--r); margin-bottom: 1.6rem; flex-wrap: wrap; }
.idea-vote-cta p { margin: 0; font-size: .85rem; flex: 1; min-width: 180px; }
.prose { color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }
.prose h3, .prose h4 { color: var(--ink); margin-top: 1.2rem; }
.prose ul { padding-left: 1.2rem; }
.note { padding: .8rem 1rem; border-radius: var(--r-sm); font-size: .9rem; margin: 1.2rem 0; }
.note-info { background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3); color: #0e7490; }
.note-error { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3); color: #b91c1c; }
.official { background: #f8f9ff; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--r); padding: 1.2rem; margin: 1.6rem 0; }
.official-head { display: flex; align-items: center; gap: .5rem; font-weight: 700; margin-bottom: .6rem; }

.comments { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.comments h2 { font-size: 1.2rem; }
.comment { display: flex; gap: .8rem; padding: 1rem 0; border-bottom: 1px solid var(--line-2); }
.comment-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.official-comment { background: #f8f9ff; border-radius: var(--r); padding: 1rem; border: 1px solid var(--line); }
.comment-form { margin-top: 1.2rem; display: grid; gap: .7rem; }
.login-prompt { margin-top: 1.2rem; }

.idea-aside { display: grid; gap: 1rem; position: sticky; top: 84px; }
.aside-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; box-shadow: var(--shadow-sm); }
.aside-card h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .7rem; }
.aside-card-head { display: flex; justify-content: space-between; align-items: center; }
.aside-card-head h4 { margin: 0; }
.kv { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Forms ---------- */
input[type=text], input[type=email], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: .65rem .8rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
textarea { resize: vertical; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2rem; box-shadow: var(--shadow-sm); }
.auth-card { max-width: 440px; margin: 2rem auto; text-align: center; }
.auth-card .field { text-align: left; }
.stack { display: grid; gap: 1.1rem; }
.stack-sm { display: grid; gap: .6rem; }
.field { display: grid; gap: .35rem; }
.field-label { font-weight: 600; font-size: .9rem; }
.field-inline { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
.field-inline select { width: auto; flex: 1; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.type-opt { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.1rem; border: 2px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 600; transition: all .15s; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt .type-ico { font-size: 1.6rem; }
.type-opt.active, .type-opt:has(input:checked) { border-color: var(--primary); background: rgba(99,102,241,.06); color: var(--primary-700); }

/* ---------- Roadmap ---------- */
.roadmap { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.2rem; align-items: start; }
.road-col { background: var(--line-2); border-radius: var(--r); padding: .8rem; }
.road-col-head { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .92rem; padding: .4rem .5rem .8rem; }
.road-col-head .count { margin-left: auto; background: #fff; color: var(--muted); font-size: .76rem; padding: .1rem .5rem; border-radius: 999px; }
.road-empty { padding: 1rem .5rem; font-size: .85rem; }
.road-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .9rem; margin-bottom: .7rem; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .2s; }
.road-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.road-card h3 { font-size: .98rem; margin: .4rem 0; }
.road-card-foot { font-size: .82rem; }

/* ---------- Admin ---------- */
.admin .page-head h1 { background: none; }
.admin-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.mini-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm); }
.ms-num { display: block; font-size: 1.7rem; font-weight: 900; }
.ms-label { font-size: .8rem; color: var(--muted); }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-inline { display: flex; gap: .4rem; flex-wrap: wrap; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: #fbfbfe; }
.admin-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: #fafaff; }
.nowrap { white-space: nowrap; }
.cell-prio { width: 56px; }
.prio-badge { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; color: #fff; font-size: .95rem; background: hsl(calc(var(--p) * 1.15), 65%, 46%); }
.cell-title a { font-weight: 600; display: inline-flex; gap: .4rem; align-items: baseline; }
.cell-title a:hover { color: var(--primary-700); }
.cell-sub { font-size: .78rem; margin-top: .2rem; }
.dup { color: var(--violet); }
.warn { color: var(--amber); font-weight: 600; }
.urg { font-size: .78rem; font-weight: 700; color: var(--c); }
.status-select { width: auto; min-width: 130px; font-size: .82rem; padding: .35rem .5rem; border-color: color-mix(in srgb, var(--c) 35%, var(--line)); color: var(--c); font-weight: 600; }

.admin-detail { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.admin-main { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2rem; box-shadow: var(--shadow-sm); }
.admin-aside { display: grid; gap: 1rem; position: sticky; top: 84px; }
.spec-block { margin-top: 1.8rem; border-top: 1px solid var(--line); padding-top: 1.4rem; }
.spec-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.spec-head h2 { font-size: 1.2rem; margin: 0; }
.spec-actions { display: flex; gap: .5rem; }
.spec-content { background: #fbfbff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem; margin-top: 1rem; }
.spec-content h3, .spec-content h4, .spec-content h5 { margin-top: 1rem; color: var(--ink); }
.spec-content h3:first-child, .spec-content h4:first-child { margin-top: 0; }
.ai-analysis .prio-large { text-align: center; margin: .5rem 0 1rem; }
.prio-large span { display: block; font-size: 2.4rem; font-weight: 900; line-height: 1; color: hsl(calc(var(--p) * 1.15), 65%, 46%); }
.prio-large small { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.ai-summary { font-size: .9rem; background: #f6f7ff; padding: .7rem .8rem; border-radius: var(--r-sm); color: var(--ink-2); }

/* ---------- misc ---------- */
.toast-inline { padding: .8rem 1.1rem; border-radius: var(--r-sm); margin-bottom: 1.4rem; font-weight: 600; }
.toast-inline.success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #047857; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); display: grid; gap: 1rem; place-items: center; background: #fff; border: 1px dashed var(--line); border-radius: var(--r); }
.empty.big { padding: 5rem 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero-grid, .feature-grid, .ai-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 520px; }
  .feature-visual { max-width: 520px; }
  .idea-detail, .admin-detail { grid-template-columns: 1fr; }
  .idea-aside, .admin-aside, .board-side { position: static; }
  .board { grid-template-columns: 1fr; }
  .steps, .idea-grid, .ai-points { grid-template-columns: 1fr 1fr; }
  .roadmap { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav-toggle { display: block; order: 3; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 24px; }
  .nav-links.open { display: flex; }
  .admin-header .nav-links { background: #0e1530; }
  .nav-actions .user-chip-name { display: none; }
  .steps, .idea-grid, .stat-grid, .admin-stats, .ai-points, .roadmap, .footer-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .section { padding: 3.5rem 0; }
  .hero-grid { padding: 3rem 24px; }
  .type-toggle { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  .admin-table { min-width: 640px; }
}
