:root {
  --bg: #070d18;
  --bg-2: #0c1524;
  --panel: #101b2d;
  --text: #eaf2ff;
  --dim: #8fa3c2;
  --line: #1e334f;
  --signal: #3ec8ff;
  --signal-ink: #041018;
  --signal-dim: rgba(62, 200, 255, 0.16);
  --teal: #5eb8ff;
  --teal-dim: rgba(94, 184, 255, 0.14);
  --ok: #6fdc8c;
  --danger: #ff8f8f;
  --font: 'Onest', system-ui, sans-serif;
  --display: 'Tektur', sans-serif;
  --radius: 8px;
  --card: var(--panel);
  --cyan: var(--signal);
  --cyan-dim: var(--signal-dim);
  --green: var(--signal);
  --green-hover: #68d4ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background:
    radial-gradient(ellipse 90% 55% at 8% -5%, rgba(62, 200, 255, 0.18), transparent 52%),
    radial-gradient(ellipse 70% 45% at 100% 10%, rgba(40, 100, 220, 0.14), transparent 48%),
    linear-gradient(165deg, #070d18 0%, #0a1322 45%, #070d18 100%);
  position: relative;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar,
.page {
  position: relative;
  z-index: 1;
}

a {
  color: var(--teal);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 0.85rem;
}

.topbar-brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 1rem;
  font-size: 0.9rem;
}

.topbar-nav a {
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}

.topbar-nav a:hover {
  color: var(--text);
}

.btn-cabinet-top {
  padding: 0.4rem 0.75rem;
  color: var(--signal) !important;
  font-weight: 700;
  border: 1px solid rgba(62, 200, 255, 0.45);
  border-radius: var(--radius);
  background: var(--signal-dim);
}

.btn-cabinet-top:hover {
  background: rgba(62, 200, 255, 0.28) !important;
  color: #d7f3ff !important;
}

.page {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 3.75rem;
}

/* ——— Hero ——— */
.hero {
  display: grid;
  gap: 1.75rem;
  align-items: stretch;
  margin: 0.75rem 0 2.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.hero-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  padding: 1.5rem 1.75rem;
  background:
    linear-gradient(145deg, rgba(62, 200, 255, 0.16), transparent 55%),
    linear-gradient(25deg, #0c1628, #122038);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.hero-frame {
  width: fit-content;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(62, 200, 255, 0.18);
  border-radius: 50%;
  line-height: 0;
  transform: rotate(-3deg);
  transition: transform 0.25s ease;
}

.hero-stage:hover .hero-frame {
  transform: rotate(0deg);
}

.hero-logo {
  display: block;
  width: 168px;
  height: 168px;
  object-fit: contain;
  object-position: center;
  border-radius: 50%;
  background: #07101c;
}

.hero-stripe {
  position: absolute;
  right: -1.5rem;
  bottom: 1.1rem;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(234, 242, 255, 0.28);
  white-space: nowrap;
  transform: rotate(-90deg);
  transform-origin: right bottom;
}

.hero-kicker {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}

.hero-brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.6rem, 13vw, 6rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--text);
  text-shadow: 4px 4px 0 rgba(62, 200, 255, 0.28);
}

.hero-tagline {
  margin: 0.65rem 0 0.95rem;
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  font-weight: 600;
  color: var(--dim);
}

.pitch {
  margin: 0 0 1.35rem;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
}

.btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.channel-handle {
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--dim);
  text-decoration: none;
}

.channel-handle:hover {
  color: var(--teal);
}

.btn-main,
.btn-side,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.05rem;
  font-family: var(--font);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-main {
  color: var(--signal-ink);
  background: var(--signal);
}

.btn-main:hover {
  background: #68d4ff;
  transform: translateY(-1px);
}

.btn-side {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.btn-side:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-dim);
}

.btn-ghost {
  color: var(--dim);
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.btn-ghost:hover {
  color: var(--text);
}

.btn-main:disabled,
.btn-side:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2.75rem;
    align-items: center;
  }

  .hero-stage {
    justify-self: start;
    padding: 1.75rem 2rem;
  }

  .hero-logo {
    width: 220px;
    height: 220px;
  }

  .hero-frame {
    transform: rotate(-4deg);
  }
}

/* ——— Layout ——— */
.page-layout {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.page-main,
.ideas-sidebar {
  min-width: 0;
}

@media (min-width: 960px) {
  .page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    gap: 2.25rem;
    align-items: start;
  }

  .ideas-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }
}

.section-head {
  margin-bottom: 0.85rem;
}

.block-title {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: none;
}

.block-lead {
  margin: 0;
  color: var(--dim);
  font-size: 0.98rem;
  line-height: 1.45;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  counter-reset: feat;
}

.feature {
  counter-increment: feat;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.95rem;
  padding: 1rem 1rem 1rem 1.1rem;
  background: rgba(20, 28, 43, 0.72);
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.feature:nth-child(even) {
  border-left-color: var(--teal);
  margin-left: 0.65rem;
}

.feature::before {
  content: counter(feat, decimal-leading-zero);
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(139, 151, 171, 0.55);
}

.feature-icon {
  font-size: 1.25rem;
  line-height: 1.3;
}

.feature h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
  padding-right: 2rem;
}

.feature p {
  margin: 0;
  grid-column: 2;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--dim);
}

/* ——— Ideas ——— */
.ideas-block {
  position: relative;
  padding: 1.15rem 1.1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.ideas-ticket {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: -1.15rem -1.1rem 1rem;
  padding: 0.45rem 1.1rem;
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal-ink);
  background: repeating-linear-gradient(
    -45deg,
    var(--signal),
    var(--signal) 8px,
    #68d4ff 8px,
    #68d4ff 16px
  );
}

.ideas-note {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--dim);
}

.ideas-note a {
  color: var(--signal);
  font-weight: 700;
  text-decoration: none;
}

.ideas-note a:hover {
  text-decoration: underline;
}

.btn-text {
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
}

.btn-text:hover {
  text-decoration: underline;
}

.idea-form,
.cabinet-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  padding: 0.95rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dim);
}

.field input,
.field textarea,
.filter-label select,
.admin-row select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field input:focus,
.field textarea:focus,
.filter-label select:focus,
.admin-row select:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 2px var(--signal-dim);
}

.btn-submit {
  align-self: flex-start;
  border: none;
}

.form-msg {
  margin: 0;
  font-size: 0.85rem;
}

.form-msg--ok {
  color: var(--ok);
}

.form-msg--err {
  color: var(--danger);
}

.tg-auth {
  margin-top: 0.35rem;
}

.auth-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--dim);
  line-height: 1.55;
}

.tg-auth-text {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--dim);
  line-height: 1.5;
}

.tg-auth-text--ok {
  color: var(--text);
}

.tg-code-box {
  margin-top: 1rem;
  padding: 1rem;
  background:
    linear-gradient(90deg, var(--signal-dim), transparent 40%),
    var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tg-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.tg-code-label {
  margin: 0;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.tg-code-badge {
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--signal);
  border: 1px solid rgba(62, 200, 255, 0.4);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.tg-code-value {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 7vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--signal);
}

.tg-auth-wait {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--teal);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.ideas-empty {
  margin: 0;
  color: var(--dim);
  font-size: 0.9rem;
}

.idea-card {
  padding: 0.95rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.idea-card--clickable {
  cursor: pointer;
}

.idea-card--clickable:hover {
  border-color: rgba(62, 200, 255, 0.45);
}

.idea-card.has-thread:not(.is-expanded) {
  border-color: rgba(63, 213, 192, 0.35);
}

.idea-open-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--teal);
}

.idea-card-details {
  margin-top: 0.75rem;
}

.idea-thread-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--dim);
}

.idea-card-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.idea-card-main {
  flex: 1;
  min-width: 0;
}

.idea-votes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.idea-votes--readonly .vote-btn {
  cursor: default;
  opacity: 0.85;
}

.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 2.6rem;
  padding: 0.35rem 0.4rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dim);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.vote-btn:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--text);
}

.vote-btn.is-active.vote-like {
  color: var(--ok);
  border-color: rgba(111, 220, 140, 0.5);
  background: rgba(111, 220, 140, 0.1);
}

.vote-btn.is-active.vote-dislike {
  color: var(--danger);
  border-color: rgba(255, 143, 143, 0.45);
  background: rgba(255, 120, 120, 0.1);
}

.vote-btn:disabled {
  cursor: not-allowed;
}

.vote-icon {
  font-size: 1rem;
  line-height: 1;
}

.vote-count {
  font-variant-numeric: tabular-nums;
}

.idea-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.idea-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.85rem;
}

.idea-meta time {
  color: var(--dim);
  font-size: 0.76rem;
}

.idea-tg-user {
  font-weight: 500;
  color: var(--teal);
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
  white-space: nowrap;
}

.status-pending {
  color: #e0c35a;
  background: rgba(224, 195, 90, 0.12);
}

.status-in_development {
  color: var(--teal);
  background: var(--teal-dim);
}

.status-implemented {
  color: var(--ok);
  background: rgba(111, 220, 140, 0.12);
}

.status-rejected {
  color: var(--danger);
  background: rgba(255, 143, 143, 0.12);
}

.status-not_done {
  color: #b5a99a;
  background: rgba(181, 169, 154, 0.1);
}

.idea-text {
  margin: 0;
  line-height: 1.5;
  font-size: 0.92rem;
}

.idea-replies {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.idea-reply {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.idea-reply--developer {
  background: var(--teal-dim);
}

.idea-reply--author {
  background: rgba(111, 220, 140, 0.1);
}

.idea-author-reply-form {
  margin-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.idea-reply p {
  margin: 0.2rem 0;
  line-height: 1.45;
}

.idea-reply time {
  font-size: 0.74rem;
  color: var(--dim);
}

.idea-admin {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--dim);
}

.admin-row select {
  flex: 1;
  min-width: 10rem;
}

.admin-reply-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}

.btn-danger {
  align-self: flex-start;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffb4a8;
  background: rgba(255, 120, 120, 0.12);
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: var(--radius);
  cursor: pointer;
}

.btn-danger:hover {
  background: rgba(255, 120, 120, 0.2);
}

/* Auth */
.auth-body {
  min-height: 100vh;
}

.auth-page {
  max-width: 42rem;
}

.auth-panel {
  padding: 0.35rem 0 0.5rem;
}

.auth-title {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-subtitle {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
}

.auth-hint {
  margin: 0 0 1.1rem;
  font-size: 0.94rem;
  color: var(--dim);
  line-height: 1.45;
}

.auth-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.85rem 0;
}

.cabinet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cabinet-ideas {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

@media (max-width: 640px) {
  .hero-stage {
    margin-inline: auto;
  }

  .hero-logo {
    width: 140px;
    height: 140px;
  }

  .btns {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-main,
  .btn-side,
  .btn-submit {
    width: 100%;
  }

  .btn-ghost {
    width: auto;
    align-self: flex-start;
  }

  .feature:nth-child(even) {
    margin-left: 0;
  }
}
