:root {
  /* Mobile-first — matches Flutter SastioColors */
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-card: #0a0a0a;
  --bg-panel: #0a0a0a;
  --bg-input: #000000;
  --border: rgba(28, 180, 228, 0.55);
  --border-strong: #1cb4e4;
  --text: #ffffff;
  --muted: #a3a3a3;
  --muted-dark: #737373;
  --blue: #0a8bb7;
  --blue-bright: #1cb4e4;
  --blue-soft: rgba(28, 180, 228, 0.16);
  --green: #3dd68c;
  --orange: #f0a35e;
  --danger: #ff6b7a;
  --radius: 14px;
  --shadow: none;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Golos Text", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  padding-bottom: calc(64px + var(--safe-bottom));
  background: #000;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

::placeholder {
  color: #737373;
  opacity: 1;
}

.glow {
  display: none;
}

body.route-home {
  background: #000;
}

body.route-home .tabbar-wrap {
  background: #000;
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 24px;
}

#app.page-padded {
  width: min(640px, calc(100% - 36px));
  padding-top: 16px;
}

#app.home-app {
  padding: 0;
  background: #000;
}

/* Mobile: app-like column. Desktop: full-width responsive shell */
.phone-shell {
  width: 100%;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
}

.home-hero {
  width: 100%;
  background: #000;
  line-height: 0;
}

.home-hero img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
}

.home-body {
  width: min(640px, calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 0 32px;
  background: transparent;
}

body.route-home .tabbar {
  width: 100%;
}

@media (max-width: 639px) {
  .phone-shell {
    width: min(430px, 100%);
  }

  .home-body {
    width: 100%;
    padding: 8px 20px 28px;
    background: #000;
  }

  body.route-home .tabbar {
    width: 100%;
  }
}

@media (min-width: 640px) {
  body.route-home {
    background: var(--bg);
  }

  #app.home-app {
    background: var(--bg);
  }

  .phone-shell {
    background: transparent;
  }

  .home-hero {
    width: min(720px, calc(100% - 64px));
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
  }

  .home-hero img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .home-body {
    width: min(720px, calc(100% - 64px));
    padding: 24px 0 40px;
  }

  .home-body textarea {
    min-height: 140px;
  }

  .how-copy .step h3 {
    font-size: 14px;
  }

  .how-copy .step p {
    font-size: 12px;
  }

  .how-line {
    left: 48px;
    right: 48px;
  }

  body.route-home .tabbar {
    width: 100%;
  }

  #app.page-padded {
    width: min(640px, calc(100% - 64px));
    padding-top: 28px;
  }

  .tabbar {
    width: 100%;
  }

  .legal-wrap {
    width: min(860px, calc(100% - 64px));
  }

  .support-wrap {
    width: min(640px, calc(100% - 64px));
  }
}

@media (min-width: 1024px) {
  .home-hero {
    width: min(760px, calc(100% - 80px));
    border-radius: 18px;
  }

  .home-body {
    width: min(760px, calc(100% - 80px));
    padding-top: 28px;
  }

  .section-label {
    font-size: 16px;
  }

  .btn-submit {
    max-width: 420px;
  }

  .how {
    margin-top: 36px;
  }

  body.route-home .tabbar,
  .tabbar {
    width: min(760px, calc(100% - 64px));
  }

  #app.page-padded {
    width: min(680px, calc(100% - 80px));
  }
}

.signed-banner {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--blue-bright);
}

.section-label.section-gap {
  margin-top: 18px;
}

.section-label svg {
  color: var(--blue-bright);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field.field-flush {
  margin-bottom: 0;
}

.field.field-gap {
  margin-bottom: 10px;
}

.home-body textarea {
  min-height: 120px;
  font-size: 15px;
}

.home-body .char-count {
  margin-top: 6px;
  margin-bottom: 0;
  font-size: 12px;
}

.select-plain {
  width: 100%;
  appearance: none;
  background: #000
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231CB4E4' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  border: 1.2px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 40px 14px 14px;
  outline: none;
  color: var(--text);
}

.select-plain:focus {
  border-color: var(--blue-bright);
  border-width: 1.8px;
  box-shadow: none;
}

.btn-submit {
  margin-top: 18px;
  min-height: 52px;
}

/* How it works — matches Flutter HowItWorksRow */
.how {
  margin-top: 28px;
}

.how-icons {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  height: 48px;
  margin-bottom: 10px;
}

.how-line {
  position: absolute;
  left: 36px;
  right: 36px;
  top: 50%;
  height: 0;
  border-top: 1.2px dashed rgba(28, 180, 228, 0.45);
  z-index: 0;
}

.how-icons .step-icon {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #000;
  color: var(--blue-bright);
  border: 1.2px solid var(--blue-bright);
}

.how-icons .step-icon svg {
  width: 20px;
  height: 20px;
}

.how-copy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.how-copy .step {
  text-align: center;
  padding: 0 4px;
}

.how-copy .step h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-bright);
}

.how-copy .step p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
}

.page-logo {
  display: block;
  height: 48px;
  width: auto;
  margin: 8px auto 16px;
  object-fit: contain;
}

.page-title {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 4.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  line-height: 1.15;
  color: var(--blue-bright);
}

.page-sub {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
  font-size: 0.92rem;
}

.card {
  background: #0a0a0a;
  border: 1.2px solid var(--border-strong);
  border-radius: 14px;
  padding: 18px;
  box-shadow: none;
}

.card-tight {
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: var(--bg-panel);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--blue-bright);
}

.section-label svg {
  color: var(--blue-bright);
  flex-shrink: 0;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field > span {
  color: var(--blue-bright);
  font-size: 0.92rem;
  font-weight: 600;
}

.input-wrap,
textarea,
select,
.field input {
  width: 100%;
  background: #000;
  border: 1.2px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.input-wrap svg {
  color: var(--blue-bright);
  flex-shrink: 0;
}

.input-wrap input,
.input-wrap select {
  border: 0;
  background: transparent;
  padding: 12px 0;
  width: 100%;
  outline: none;
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.45;
}

.input-wrap:focus-within,
textarea:focus,
select:focus,
.field input:focus {
  border-color: var(--blue-bright);
  border-width: 1.8px;
  box-shadow: none;
}

.char-count {
  text-align: right;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: -6px;
  margin-bottom: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 28px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue-bright);
  color: #000;
}

.btn-ghost {
  background: transparent;
  border: 1.4px solid var(--blue-bright);
  color: var(--blue-bright);
}

.btn-row {
  display: grid;
  gap: 10px;
}

.form-msg {
  margin: 10px 0 0;
  min-height: 1.2em;
  font-size: 0.92rem;
}

.form-msg.ok {
  color: var(--green);
}

.form-msg.err {
  color: var(--danger);
}

.home-body .signed-banner {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0 8px;
  position: relative;
}

.step {
  text-align: center;
  padding: 8px 4px;
}

.step-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #000;
  color: var(--blue-bright);
  border: 1.2px solid var(--blue-bright);
}

.step h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 16px;
  padding: 12px 6px;
  border-radius: 14px;
  background: #000;
  border: 1.2px solid var(--border-strong);
}

.benefit {
  text-align: center;
  padding: 8px 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.25;
  border-right: 1px solid rgba(28, 180, 228, 0.35);
}

.benefit:last-child {
  border-right: 0;
}

.benefit svg {
  display: block;
  margin: 0 auto 6px;
  color: var(--blue-bright);
}

.auth-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: #000;
  border-radius: 12px;
  border: 1.2px solid var(--border-strong);
}

.auth-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.auth-toggle button.active {
  background: var(--blue-bright);
  color: #000;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}

.idea-card {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.idea-card-link {
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.idea-card-link:hover {
  border-color: rgba(28, 180, 228, 0.55);
}

.idea-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.idea-card-top .idea-chevron {
  color: #cfcfcf;
}

.idea-card-top svg {
  color: inherit;
  flex-shrink: 0;
}

.status-pill {
  display: inline-block;
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 13px;
}

.status-pill.inline {
  margin: 0 0 8px;
}

.reply-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(28, 180, 228, 0.15);
  color: var(--blue-bright);
  font-size: 11px;
  font-weight: 600;
}

.match-line {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.muted-soft {
  color: #737373;
  font-size: 12px;
}

.idea-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty {
  text-align: center;
  padding: 22px 16px 16px;
}

.empty-art {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--blue-bright);
  background: #000;
  color: var(--blue-bright);
  position: relative;
}

.empty-art .lock-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-bright);
  color: #000;
  display: grid;
  place-items: center;
  box-shadow: none;
  border: 2px solid #000;
}

.empty-art .lock-badge svg {
  width: 14px;
  height: 14px;
}

.empty h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--blue-bright);
}

.empty p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.85rem;
}

.lock-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.link-list a:last-child {
  border-bottom: 0;
}

.link-list .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.link-list svg {
  color: var(--blue-bright);
}

.avatar {
  width: 96px;
  height: 96px;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #000;
  border: 1.5px solid var(--blue-bright);
  color: var(--muted);
  overflow: hidden;
}

.avatar svg {
  width: 42px;
  height: 42px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.center {
  text-align: center;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Flat tab bar (matches Flutter BottomNavigationBar) ---------- */

.tabbar-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0;
  pointer-events: none;
  background: #000;
  border-top: 1px solid rgba(28, 180, 228, 0.35);
}

.tabbar {
  pointer-events: auto;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: #000;
  border: 0;
  border-radius: 0;
}

.tab {
  flex: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 0;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease;
  background: transparent;
}

.tab-wide {
  flex: 1;
}

.tab svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.tab.active {
  background: transparent;
  color: var(--blue-bright);
  font-weight: 700;
}

.tab-divider {
  display: none;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.progress-stack {
  display: grid;
  gap: 10px;
}

/* ---------- Legal pages (privacy / terms) ---------- */

body.legal-page {
  padding-bottom: 40px;
}

.legal-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(
    to bottom,
    rgba(5, 7, 12, 0.96),
    rgba(5, 7, 12, 0.85),
    transparent
  );
  backdrop-filter: blur(8px);
}

.legal-brand img {
  height: 36px;
  width: auto;
  display: block;
}

.legal-back {
  color: var(--blue-bright);
  font-weight: 600;
  font-size: 0.9rem;
}

.legal-wrap {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 8px 0 32px;
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.legal-toc a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--blue-bright);
  font-weight: 600;
  font-size: 0.85rem;
}

.legal-updated {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px;
  margin-bottom: 18px;
}

.legal-card h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  letter-spacing: -0.03em;
}

.legal-card h2 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
  color: var(--blue-bright);
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.legal-card p {
  margin: 0 0 10px;
}

.legal-card ul {
  margin: 0 0 10px;
  padding-left: 1.2em;
}

.legal-card li {
  margin-bottom: 6px;
}

.legal-card strong {
  color: var(--text);
}

.legal-card a {
  color: var(--blue-bright);
  font-weight: 600;
}

.legal-footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 28px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.legal-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.legal-footer a {
  color: var(--blue-bright);
  font-weight: 600;
}

.legal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.support-wrap {
  width: min(560px, calc(100% - 36px));
}

.support-card {
  margin-bottom: 14px;
  text-align: center;
}

.support-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.support-card .field {
  text-align: left;
}

.support-icon {
  width: 56px;
  height: 56px;
  margin: 4px auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-bright);
  border: 1px solid rgba(28, 180, 228, 0.3);
}

.support-email-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.support-email-line a {
  color: var(--blue-bright);
  font-weight: 700;
}

.support-card .btn {
  margin-top: 14px;
}

/* Desktop overrides last so they win over base phone-width rules */
@media (min-width: 640px) {
  .home-body {
    width: min(720px, calc(100% - 64px));
    padding: 24px 0 40px;
  }

  body.route-home .tabbar,
  .tabbar {
    width: 100%;
  }

  #app.page-padded {
    width: min(640px, calc(100% - 64px));
    padding-top: 28px;
  }

  .legal-wrap {
    width: min(860px, calc(100% - 64px));
  }

  .support-wrap {
    width: min(640px, calc(100% - 64px));
  }

  .home-hero {
    width: min(720px, calc(100% - 64px));
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
  }

  .home-hero img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

@media (min-width: 1024px) {
  .home-hero {
    width: min(760px, calc(100% - 80px));
    border-radius: 18px;
  }

  .home-body {
    width: min(760px, calc(100% - 80px));
    padding-top: 28px;
  }

  body.route-home .tabbar,
  .tabbar {
    width: 100%;
  }

  #app.page-padded {
    width: min(680px, calc(100% - 80px));
  }

  .legal-wrap {
    width: min(920px, calc(100% - 80px));
  }

  .support-wrap {
    width: min(680px, calc(100% - 80px));
  }
}

/* ---------- Home logo ---------- */
.home-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 16px;
}

.home-logo {
  display: block;
  height: 48px;
  width: auto;
  object-fit: contain;
}

/* ---------- Idea detail / chat ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue-bright);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
}

.back-link svg {
  width: 18px;
  height: 18px;
}

.idea-detail-text {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.45;
}

.match-card {
  margin-top: 18px;
}

.match-label {
  margin: 0 0 6px;
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 13px;
}

.match-name {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 700;
}

.match-actions .match-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.match-btn {
  min-height: 42px;
}

.section-heading {
  margin: 18px 0 10px;
  color: var(--blue-bright);
  font-size: 15px;
  font-weight: 700;
}

.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.msg-row {
  display: flex;
}

.msg-row.mine {
  justify-content: flex-end;
}

.msg-row.theirs {
  justify-content: flex-start;
}

.msg-bubble {
  max-width: 82%;
  padding: 10px 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(28, 180, 228, 0.4);
  background: var(--bg-card);
}

.msg-row.mine .msg-bubble {
  border-color: rgba(28, 180, 228, 0.8);
  background: rgba(28, 180, 228, 0.18);
}

.msg-sender {
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 4px;
}

.msg-body {
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-time {
  margin-top: 6px;
  color: #737373;
  font-size: 11px;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(28, 180, 228, 0.35);
}

.composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  background: var(--bg-input);
  border: 1.2px solid rgba(28, 180, 228, 0.55);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.composer textarea:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(10, 139, 183, 0.18);
}

.composer-send {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.composer-send svg {
  width: 18px;
  height: 18px;
}

body.is-admin .tabbar {
  gap: 0;
}

#admin-tab[hidden],
#admin-tab-divider[hidden],
#admin-top-link[hidden],
.top-link[hidden],
.tab[hidden],
.tab-divider[hidden] {
  display: none !important;
}

body:not(.is-admin) #admin-tab,
body:not(.is-admin) #admin-tab-divider,
body:not(.is-admin) #admin-top-link {
  display: none !important;
}

.tabbar:has(.tab[data-tab="admin"].active) .tab-divider:nth-of-type(3),
.tabbar:has(.tab[data-tab="progress"].active) .tab-divider:nth-of-type(3) {
  opacity: 0;
}

/* ---------- Desktop top nav (hidden on mobile) ---------- */
.topnav {
  display: none;
}

.auth-shell {
  width: 100%;
}

.auth-switch-line {
  margin: 12px 0 0;
}

.auth-switch-line a {
  color: var(--blue-bright);
  font-weight: 700;
}

.idea-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.idea-card-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.idea-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.idea-chevron {
  color: var(--muted);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.idea-chevron svg {
  width: 20px;
  height: 20px;
}

.progress-gate,
.progress-signed-in {
  width: 100%;
}

.progress-heading,
.progress-sub {
  text-align: left;
}

.gate-links {
  margin-top: 12px;
}

/* ---------- Profile / auth extras (app parity) ---------- */
.profile-card {
  margin-bottom: 14px;
}

.profile-photo-wrap {
  margin-bottom: 16px;
}

.avatar-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.camera-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-bright);
  color: #000;
  display: grid;
  place-items: center;
  border: 2px solid #000;
}

.camera-badge svg {
  width: 14px;
  height: 14px;
}

.change-photo-link {
  display: block;
  margin: 10px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-bright);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.field-affix {
  display: inline-flex;
  color: var(--blue-bright);
  flex-shrink: 0;
}

.field-affix svg {
  width: 16px;
  height: 16px;
}

.eye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-bright);
  cursor: pointer;
  flex-shrink: 0;
}

.eye-btn svg {
  width: 18px;
  height: 18px;
}

.profile-links {
  padding: 4px 12px;
  margin-bottom: 14px;
}

.profile-links a,
.profile-links .danger-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 4px;
  border: 0;
  border-bottom: 1px solid rgba(28, 180, 228, 0.25);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-links a:last-child,
.profile-links .danger-link:last-child {
  border-bottom: 0;
}

.danger-link,
.danger-link .left,
.danger-link svg {
  color: var(--danger) !important;
}

.signout-btn {
  margin-top: 4px;
  margin-bottom: 8px;
}

.guest-btn {
  gap: 10px;
}

.guest-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Desktop layout (≥900px) matching mockups ---------- */
@media (min-width: 900px) {
  :root {
    --bg: #000000;
    --bg-card: #0a0a0a;
    --bg-input: #000000;
    --bg-elev: #0a0a0a;
    --border: rgba(28, 180, 228, 0.55);
  }

  html,
  body {
    background: #000;
  }

  body {
    padding-bottom: 0;
    padding-top: 72px;
  }

  .glow {
    display: none;
  }

  .tabbar-wrap {
    display: none !important;
  }

  .topnav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 64px;
    padding: 0 40px;
    background: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .topnav-brand {
    display: inline-flex;
    align-items: center;
  }

  .topnav-brand img {
    height: 34px;
    width: auto;
    display: block;
  }

  .topnav-links {
    display: flex;
    align-items: center;
    gap: 28px;
  }

  .top-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 14px;
    color: #cfcfcf;
    font-size: 15px;
    font-weight: 600;
  }

  .top-link svg {
    width: 18px;
    height: 18px;
  }

  .top-link:hover {
    color: var(--blue-bright);
  }

  .top-link.active {
    color: var(--blue-bright);
  }

  .top-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--blue-bright);
  }

  #app {
    width: min(720px, calc(100% - 80px));
    margin: 0 auto;
    padding: 28px 0 64px;
  }

  #app.page-padded {
    width: min(720px, calc(100% - 80px));
    padding-top: 28px;
  }

  #app.home-app {
    width: min(640px, calc(100% - 80px));
    background: transparent;
    padding: 12px 0 64px;
  }

  /* Home — logo + form + how-it-works (no hero banner on desktop) */
  .phone-shell {
    background: transparent;
    min-height: auto;
  }

  .home-hero {
    display: none;
  }

  .home-body {
    width: 100%;
    padding: 8px 0 0;
    background: transparent;
  }

  .home-logo-wrap {
    margin: 8px 0 20px;
  }

  .home-logo {
    height: 56px;
  }

  .home-body .section-label {
    color: var(--blue-bright);
    font-size: 16px;
  }

  .home-body textarea,
  .home-body .select-plain,
  .home-body .input-wrap {
    border-color: rgba(28, 180, 228, 0.7);
    background: #000;
  }

  .btn-primary {
    border-radius: 999px;
    background: var(--blue-bright);
    color: #000;
    font-weight: 700;
  }

  .btn-submit {
    max-width: none;
    width: 100%;
    min-height: 52px;
    border-radius: 999px;
  }

  .btn-ghost {
    border-radius: 999px;
    border-color: var(--blue-bright);
    color: var(--blue-bright);
  }

  .how {
    margin-top: 40px;
  }

  .how-line {
    border-top-color: rgba(28, 180, 228, 0.45);
  }

  .how-icons .step-icon {
    border-color: var(--blue-bright);
    color: var(--blue-bright);
    background: #000;
  }

  .how-copy .step h3 {
    color: var(--blue-bright);
    font-size: 15px;
  }

  .how-copy .step p {
    color: #ddd;
    font-size: 13px;
  }

  /* Auth — centered panel card */
  body.route-auth #app.page-padded {
    width: min(560px, calc(100% - 80px));
  }

  .auth-shell {
    display: flex;
    justify-content: center;
  }

  .auth-panel {
    width: 100%;
    padding: 28px 28px 22px;
    border: 1.5px solid rgba(28, 180, 228, 0.65);
    border-radius: 22px;
    background: #0a0a0a;
  }

  .auth-panel .page-logo {
    display: block;
    margin: 0 auto 10px;
    height: 52px;
  }

  .auth-panel .page-title {
    text-align: center;
    color: var(--blue-bright);
    font-size: 22px;
    margin: 0 0 6px;
  }

  .auth-panel .page-sub {
    text-align: center;
    margin: 0 0 18px;
  }

  .auth-panel .input-wrap,
  .auth-panel input {
    background: #000;
  }

  .auth-panel .btn-primary {
    width: 100%;
    margin-top: 6px;
  }

  .auth-panel .btn-ghost {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .auth-panel .benefits {
    margin-top: 18px;
    padding: 14px 8px;
    border: 1px solid rgba(28, 180, 228, 0.35);
    border-radius: 14px;
    background: #000;
  }

  /* Progress gate (signed out) */
  .progress-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
  }

  .progress-gate .page-logo {
    height: 56px;
    margin-bottom: 10px;
  }

  .progress-gate .page-title {
    color: var(--blue-bright);
    font-size: 34px;
    margin: 0 0 8px;
  }

  .progress-gate .page-sub {
    margin-bottom: 22px;
  }

  .gate-card {
    width: 100%;
    border: 1.5px solid rgba(28, 180, 228, 0.7);
    background: #0a0a0a;
    padding: 28px 24px 20px;
  }

  .gate-card h2 {
    color: var(--blue-bright);
    font-size: 20px;
  }

  .gate-card .btn-row {
    display: grid;
    gap: 10px;
  }

  .gate-card .btn {
    width: 100%;
    border-radius: 999px;
  }

  .gate-links {
    width: 100%;
    margin-top: 14px;
    border: 1.5px solid rgba(28, 180, 228, 0.55);
    background: #0a0a0a;
    padding: 4px 10px;
  }

  .gate-links a {
    border-bottom-color: rgba(28, 180, 228, 0.25);
    padding: 16px 6px;
  }

  /* Progress signed-in list */
  .progress-signed-in {
    max-width: 720px;
    margin: 0 auto;
  }

  .progress-heading {
    color: var(--blue-bright);
    font-size: 34px;
    margin: 0 0 8px;
  }

  .progress-sub {
    margin: 0 0 22px;
  }

  .idea-card {
    border: 1.5px solid rgba(28, 180, 228, 0.7);
    background: #000;
    padding: 18px 18px;
    border-radius: 16px;
  }

  .idea-title {
    font-size: 1.25rem;
    font-weight: 700;
  }

  /* Profile / admin / detail share content width */
  body.route-profile #app.page-padded,
  body.route-admin #app.page-padded {
    width: min(640px, calc(100% - 80px));
  }

  .card {
    border-color: rgba(28, 180, 228, 0.55);
    background: #0a0a0a;
  }

  .input-wrap,
  textarea,
  .select-plain {
    border-color: rgba(28, 180, 228, 0.65);
  }

  .page-title {
    color: var(--blue-bright);
  }
}

@media (min-width: 1200px) {
  .topnav {
    padding: 0 64px;
  }

  #app.home-app {
    width: min(680px, calc(100% - 120px));
  }

  body.route-auth #app.page-padded {
    width: min(580px, calc(100% - 120px));
  }

  .progress-signed-in {
    max-width: 780px;
  }
}

.seo-article h1 {
  color: var(--blue-bright);
  font-size: 1.85rem;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 0 0 14px;
}

.seo-article .legal-card h2 {
  margin-top: 0;
}

.seo-article .legal-card h3 {
  margin: 18px 0 8px;
  font-size: 1.05rem;
  color: var(--text);
}

.seo-steps {
  margin: 0;
  padding-left: 1.2em;
}

.seo-steps li {
  margin: 0 0 12px;
}

.seo-article .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

/* ---------- Welcome popup (sastio.com) ---------- */
html.welcome-pending .topnav,
html.welcome-pending .tabbar-wrap,
html.welcome-pending #app,
html.welcome-pending .glow,
body.welcome-open .topnav,
body.welcome-open .tabbar-wrap,
body.welcome-open #app,
body.welcome-open .glow {
  filter: blur(12px);
  pointer-events: none;
  user-select: none;
}

.topnav,
.tabbar-wrap,
#app,
.glow {
  transition: filter 0.35s ease;
}

body.welcome-open {
  overflow: hidden;
}

.welcome {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html.welcome-pending .welcome,
body.welcome-open .welcome,
.welcome.welcome-out {
  display: flex;
}

.welcome[hidden] {
  display: none !important;
}

.welcome-glow {
  position: absolute;
  width: min(560px, 90vw);
  height: min(520px, 70vh);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28, 180, 228, 0.22), transparent 68%);
  pointer-events: none;
}

.welcome-inner {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 28px 24px 22px;
  text-align: center;
  background: rgba(8, 8, 8, 0.92);
  border: 1.4px solid rgba(28, 180, 228, 0.55);
  border-radius: 22px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(28, 180, 228, 0.12);
  animation: welcome-in 0.45s ease both;
}

@keyframes welcome-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.welcome-logo {
  display: block;
  width: min(300px, 88%);
  height: auto;
  margin: 0 auto 20px;
}

.welcome-inner h1 {
  margin: 0 0 10px;
  color: var(--blue-bright);
  font-size: clamp(1.4rem, 4.5vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.welcome-sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.welcome-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.welcome-points li {
  padding: 11px 14px;
  border: 1.2px solid rgba(28, 180, 228, 0.55);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.welcome-enter {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: 56px;
  padding: 0 22px;
  border: 1.6px solid var(--blue-bright);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(28, 180, 228, 0.35);
  transition: box-shadow 0.25s ease;
}

.welcome-enter:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 4px;
}

.welcome-enter.is-filling {
  box-shadow: 0 0 28px 2px rgba(28, 180, 228, 0.28);
}

.welcome-enter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--blue-bright);
  z-index: 0;
  transition: width 0.9s linear;
}

.welcome-enter.is-filling .welcome-enter-fill {
  width: 100%;
}

.welcome-enter-label {
  position: relative;
  z-index: 1;
  color: var(--blue-bright);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color 0.35s ease;
}

.welcome-enter.is-filling .welcome-enter-label,
.welcome-enter:active .welcome-enter-label {
  color: #000;
}

.welcome-hint {
  margin: 14px 0 0;
  color: var(--muted-dark);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.welcome-hint-tap {
  display: none;
}

@media (hover: none) {
  .welcome-hint-hover {
    display: none;
  }

  .welcome-hint-tap {
    display: block;
  }
}

.welcome-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}

.welcome-out .welcome-inner {
  transform: translateY(8px) scale(0.97);
  transition: transform 0.32s ease;
}

@media (prefers-reduced-motion: reduce) {
  .welcome-inner,
  .welcome-enter-fill,
  .welcome-enter-label,
  .welcome-out {
    animation: none;
    transition: none;
  }
}

@media (min-width: 700px) {
  .welcome-inner {
    padding: 36px 32px 26px;
  }

  .welcome-logo {
    width: 340px;
  }

  .welcome-points {
    flex-direction: row;
    gap: 10px;
  }

  .welcome-points li {
    flex: 1;
    padding: 12px 8px;
    font-size: 12px;
  }
}

