:root {
  --bg: #0d1118;
  --text: #ece8f2;
  --dim: #9d93ad;
  --card: #181422;
  --line: #2a3348;
  --cyan: #3ec8ff;
  --cyan-dim: rgba(62, 200, 255, 0.15);
  --green: #6fdc8c;
  --green-hover: #8ae9a3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(62, 200, 255, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 100% 30%, rgba(111, 220, 140, 0.06) 0%, transparent 35%);
}

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.page-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.page-main {
  min-width: 0;
}

.ideas-sidebar {
  min-width: 0;
}

@media (min-width: 960px) {
  .page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    gap: 2rem;
    align-items: start;
  }

  .ideas-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    padding-right: 0.15rem;
  }

  .ideas-sidebar .ideas-block {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
}

.page-top {
  display: flex;
  justify-content: flex-end;
  margin: -0.5rem 0 1rem;
}

.btn-cabinet-top {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-cabinet-top:hover {
  border-color: var(--cyan);
  background: var(--cyan-dim);
}

.hero-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.hero-logo {
  flex-shrink: 0;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(62, 200, 255, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(62, 200, 255, 0.2);
}

.hero-tagline {
  margin: 0;
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--dim);
}

.pitch {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  border-left: 3px solid var(--cyan);
}

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.channel-handle {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}

.channel-handle:hover {
  color: var(--cyan);
}

.btn-main,
.btn-side {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-main {
  color: #0f1410;
  background: var(--green);
}

.btn-main:hover {
  background: var(--green-hover);
  box-shadow: 0 4px 20px rgba(111, 220, 140, 0.25);
}

.btn-side {
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
}

.btn-side:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.features-block {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.block-title {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.features {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.feature {
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s;
}

.feature:hover {
  border-color: rgba(62, 200, 255, 0.25);
}

.feature-icon {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
  line-height: 1;
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.feature p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--dim);
}

/* Ideas */
.ideas-block {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.ideas-note {
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--dim);
}

.btn-text {
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  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.25rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.8rem;
  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: 10px;
}

.field input:focus,
.field textarea:focus,
.filter-label select:focus,
.admin-row select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-dim);
}

.btn-submit {
  align-self: flex-start;
  border: none;
  cursor: pointer;
}

.form-msg {
  margin: 0;
  font-size: 0.85rem;
}

.form-msg--ok {
  color: var(--green);
}

.form-msg--err {
  color: #ff8a8a;
}

.tg-auth {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.tg-auth-text {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  color: var(--dim);
  line-height: 1.45;
}

.tg-code-box {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}

.tg-code-label {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.tg-code-value {
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.tg-auth-wait {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--cyan);
}

.tg-auth a {
  color: var(--cyan);
}

.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ideas-empty {
  margin: 0;
  color: var(--dim);
  font-size: 0.9rem;
}

.idea-card {
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.idea-card--clickable {
  cursor: pointer;
  transition: border-color 0.15s;
}

.idea-card--clickable:hover {
  border-color: rgba(62, 200, 255, 0.35);
}

.idea-card.has-thread:not(.is-expanded) {
  border-color: rgba(62, 200, 255, 0.22);
}

.idea-open-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--cyan);
}

.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.4rem;
  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.15rem;
  min-width: 2.75rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dim);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.vote-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--text);
}

.vote-btn.is-active.vote-like {
  color: var(--green);
  border-color: rgba(111, 220, 140, 0.5);
  background: rgba(111, 220, 140, 0.12);
}

.vote-btn.is-active.vote-dislike {
  color: #ff9a9a;
  border-color: rgba(255, 120, 120, 0.45);
  background: rgba(255, 100, 100, 0.1);
}

.vote-btn:disabled {
  cursor: not-allowed;
}

.vote-icon {
  font-size: 1.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.6rem;
}

.idea-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
}

.idea-meta time {
  color: var(--dim);
  font-size: 0.78rem;
}

.idea-tg-user {
  font-weight: 500;
  color: var(--cyan);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pending {
  color: #f5d76e;
  background: rgba(245, 215, 110, 0.12);
}

.status-in_development {
  color: var(--cyan);
  background: var(--cyan-dim);
}

.status-implemented {
  color: var(--green);
  background: rgba(111, 220, 140, 0.12);
}

.status-rejected {
  color: #f08080;
  background: rgba(240, 128, 128, 0.12);
}

.status-not_done {
  color: #c4b8d4;
  background: rgba(196, 184, 212, 0.1);
}

.idea-text {
  margin: 0;
  line-height: 1.55;
  font-size: 0.92rem;
}

.idea-replies {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.idea-reply {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.88rem;
}

.idea-reply--developer {
  background: rgba(62, 200, 255, 0.06);
}

.idea-reply--author {
  background: rgba(111, 220, 140, 0.08);
}

.idea-author-reply-form {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.idea-reply p {
  margin: 0.25rem 0;
  line-height: 1.5;
}

.idea-reply time {
  font-size: 0.75rem;
  color: var(--dim);
}

.idea-admin {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.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.45rem 0.75rem;
  font-size: 0.82rem;
}

.btn-danger {
  align-self: flex-start;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffb4b4;
  background: rgba(255, 100, 100, 0.12);
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: 8px;
  cursor: pointer;
}

.btn-danger:hover {
  background: rgba(255, 100, 100, 0.2);
}

/* Auth page */
.auth-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.auth-page.container {
  max-width: 40rem;
}

.auth-page .form-control {
  background: var(--bg);
  border-color: var(--line);
  color: var(--text);
}

.auth-page .form-control:focus {
  background: var(--bg);
  border-color: var(--cyan);
  color: var(--text);
  box-shadow: 0 0 0 0.2rem var(--cyan-dim);
}

.auth-section {
  margin-top: 0.5rem;
}

.auth-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 5vw, 1.6rem);
  font-weight: 700;
}

.auth-hint {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--dim);
  line-height: 1.45;
}

.cabinet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cabinet-ideas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-page .cabinet-ideas {
  max-height: none;
}

@media (max-width: 640px) {
  .page {
    padding: 1.25rem 1rem 2.5rem;
  }

  .hero-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-logo {
    width: 96px;
    height: 96px;
  }

  .btns {
    flex-direction: column;
  }

  .btn-main,
  .btn-side,
  .btn-submit {
    width: 100%;
    text-align: center;
  }

  .page-top {
    position: fixed;
    top: 0.75rem;
    right: 1rem;
    left: auto;
    z-index: 30;
    margin: 0;
    justify-content: flex-end;
    width: auto;
  }

  .btn-cabinet-top {
    width: auto;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  }

  .page {
    padding-top: 3.5rem;
  }

}

@media (max-width: 400px) {
  .pitch {
    font-size: 0.98rem;
  }
}
