/* start theme variables */
:root {
  /* Deep teal-to-indigo night theme */
  --bg: #080e14;
  --bg2: #0d1520;
  --bg3: #121e2d;
  --bg4: #172436;
  --surface: #1a2d42;
  --surface2: #1e3349;
  /* Accent: warm coral + cool teal */
  --coral: #e8624a;
  --corald: #c94832;
  --coralg: rgba(232, 98, 74, .12);
  --coralg2: rgba(232, 98, 74, .22);
  --teal: #3ecfb2;
  --teald: #2aab94;
  --tealg: rgba(62, 207, 178, .1);
  --violet: #8b6bdb;
  --gold: #f0c060;
  /* Text */
  --text: #dce8f5;
  --text2: #a8bfd4;
  --text3: #6a8ba8;
  --text4: #3d6080;
  /* Borders */
  --border: rgba(62, 207, 178, .15);
  --border2: rgba(220, 232, 245, .07);
  --border3: rgba(220, 232, 245, .04);
  /* Shadows */
  --glow: rgba(62, 207, 178, .08);
}
/* end theme variables */

/* start reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 70% 40% at 80% 0%, rgba(62, 207, 178, .04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 0% 100%, rgba(139, 107, 219, .04) 0%, transparent 60%);
}

[hidden] {
  display: none !important;
}

button {
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

input,
textarea,
select {
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  background: rgba(220, 232, 245, .05);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 13px;
  outline: none;
  transition: border-color .2s, background .2s;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  background: rgba(62, 207, 178, .04);
}

input::placeholder,
textarea::placeholder {
  color: var(--text4);
}
/* end reset */

input[readonly],
textarea[readonly] {
  opacity: .78;
  cursor: default;
}

select option {
  background: var(--bg2);
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(62, 207, 178, .2);
  border-radius: 2px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .5
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0
  }

  100% {
    background-position: 200% 0
  }
}

@keyframes reveal {
  from {
    filter: blur(8px);
    opacity: 0
  }

  to {
    filter: blur(0);
    opacity: 1
  }
}

.serif {
  font-family: 'Merriweather', serif;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82em;
}

/* ── Buttons ── */
/* start buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teald));
  color: var(--bg);
  border: none;
  border-radius: 9px;
  font-weight: 700;
  font-size: .88rem;
  padding: 10px 20px;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .2px;
  box-shadow: 0 2px 16px rgba(62, 207, 178, .2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(62, 207, 178, .35);
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  font-size: .85rem;
  padding: 9px 16px;
  cursor: pointer;
  transition: all .15s;
}

.btn-ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn-danger {
  background: rgba(232, 98, 74, .1);
  border: 1px solid rgba(232, 98, 74, .25);
  color: var(--coral);
  border-radius: 9px;
  font-weight: 600;
  font-size: .88rem;
  padding: 10px 20px;
  cursor: pointer;
  transition: all .15s;
}

.btn-danger:hover {
  background: rgba(232, 98, 74, .2);
}
/* end buttons */

button:disabled,
.btn:disabled,
.tgl:disabled {
  opacity: .62;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Nav ── */
/* start navigation */
#app-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(8, 14, 20, .92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: none;
}

#nav-row {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}

.nav-post-btn {
  padding: 8px 16px;
  font-size: .84rem;
}

.nav-profile-btn {
  background: rgba(220, 232, 245, .05);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 5px 12px 5px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
}

.nav-profile-btn:hover {
  border-color: var(--border);
}

.nav-profile-name {
  font-size: .83rem;
  color: var(--text2);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#logo {
  font-family: 'Merriweather', serif;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.3px;
  cursor: pointer;
}

#logo em {
  color: var(--teal);
  font-style: italic;
  text-shadow: 0 0 20px rgba(62, 207, 178, .4);
}

#srch-wrap {
  flex: 1;
  max-width: 550px;
  position: relative;
  margin: 0 6px 0 2px;
}
/* end navigation */

#srch-wrap svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .42;
  pointer-events: none;
  color: var(--text3);
}

#srch {
  height: 40px;
  font-size: .84rem;
  border-radius: 999px;
  padding: 0 18px 0 46px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .03));
  border: 1px solid rgba(220, 232, 245, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 10px 30px rgba(0, 0, 0, .18);
  color: var(--text2);
}

#srch:hover {
  border-color: rgba(62, 207, 178, .16);
}

#srch:focus {
  border-color: rgba(62, 207, 178, .35);
  background: linear-gradient(90deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .04));
  box-shadow: 0 0 0 3px rgba(62, 207, 178, .08), inset 0 1px 0 rgba(255, 255, 255, .03), 0 10px 30px rgba(0, 0, 0, .18);
}

#srch::placeholder {
  color: #55708d;
  letter-spacing: .2px;
}

#nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#tab-row {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 8px;
  display: flex;
  border-top: 1px solid var(--border3);
  overflow-x: auto;
  scrollbar-width: none;
}

#tab-row::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text3);
  font-size: .81rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tab.on {
  color: var(--teal);
  font-weight: 700;
  border-bottom-color: var(--teal);
}

.tab:hover:not(.on) {
  color: var(--text2);
}

/* ── Mobile bottom bar ── */
#mbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 490;
  background: rgba(8, 14, 20, .97);
  border-top: 1px solid var(--border);
}

.mbtab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--text4);
  font-size: .57rem;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
}

.mbtab.on {
  color: var(--teal);
  font-weight: 700;
}

.mbtab .mico {
  font-size: 1.1rem;
  line-height: 1;
}

/* ── Main ── */
#main {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 16px 90px;
}

.app-loading-card {
  max-width: 900px;
  margin: 48px auto;
  padding: 24px;
  border: 1px solid rgba(220, 232, 245, .08);
  border-radius: 18px;
  background: rgba(12, 20, 28, .88);
  color: rgba(220, 232, 245, .9);
  text-align: center;
}

/* ── Cards ── */
.card {
  background: linear-gradient(180deg, rgba(9, 18, 33, .94), rgba(7, 13, 24, .96));
  border: 1px solid rgba(62, 207, 178, .12);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 18px;
  transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.card:hover {
  border-color: rgba(62, 207, 178, .2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .25), 0 0 0 1px rgba(62, 207, 178, .05) inset;
  transform: translateY(-2px);
}

/* alternating feed shades */
#main .card:nth-of-type(4n+1) {
  background: linear-gradient(180deg, rgba(10, 24, 45, .96), rgba(7, 14, 26, .97));
}

#main .card:nth-of-type(4n+2) {
  background: linear-gradient(180deg, rgba(16, 22, 46, .96), rgba(8, 14, 29, .97));
}

#main .card:nth-of-type(4n+3) {
  background: linear-gradient(180deg, rgba(9, 32, 38, .96), rgba(7, 14, 24, .97));
}

#main .card:nth-of-type(4n+4) {
  background: linear-gradient(180deg, rgba(19, 27, 43, .96), rgba(7, 14, 24, .97));
}

.card-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 0 16px 6px;
}

.card-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Action buttons ── */
.act {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text3);
  font-size: .82rem;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Inter', sans-serif;
}

.act:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--tealg);
}

.act.on {
  border-color: var(--teal);
  background: rgba(62, 207, 178, .15);
  color: var(--teal);
}

.act.coral {
  color: var(--text3);
}

.act.coral:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coralg);
}

.act.coral.on {
  border-color: var(--coral);
  background: var(--coralg2);
  color: var(--coral);
}

/* ── Avatar ── */
.av {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
  position: relative;
}

.av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.av-emoji {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  border-radius: 50%;
}

/* ── Tags ── */
.tag {
  font-size: .68rem;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(62, 207, 178, .07);
  border: 1px solid rgba(62, 207, 178, .18);
  color: var(--teal);
  cursor: pointer;
  transition: background .15s;
}

.tag:hover {
  background: rgba(62, 207, 178, .15);
}

/* ── Spoiler ── */
.spoiler-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  cursor: pointer;
}

.spoiler-blur {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
  transition: filter .3s ease;
}

.spoiler-wrap.revealed .spoiler-blur {
  filter: none;
  user-select: auto;
  pointer-events: auto;
}

.spoiler-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(8, 14, 20, .5);
  backdrop-filter: blur(2px);
  transition: opacity .3s ease;
  border-radius: 10px;
}

.spoiler-wrap.revealed .spoiler-overlay {
  opacity: 0;
  pointer-events: none;
}

.spoiler-badge {
  background: rgba(232, 98, 74, .15);
  border: 1px solid rgba(232, 98, 74, .35);
  color: var(--coral);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: .79rem;
  font-weight: 700;
  letter-spacing: .4px;
}

/* ── Image grids ── */
.ig1 {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  cursor: zoom-in;
  max-height: 380px;
}

.ig1 img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}

.ig1:hover img {
  transform: scale(1.01);
}

.ig2 {
  display: flex;
  gap: 3px;
  height: 220px;
  margin-bottom: 12px;
}

.ig2 .ig {
  flex: 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: zoom-in;
}

.ig2 .ig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s;
}

.ig2 .ig:hover img {
  transform: scale(1.04);
}

.ig4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 12px;
}

.ig4 .ig {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1;
  cursor: zoom-in;
}

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

.ig-more {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
}

/* ── Recommendation banner ── */
.rec-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(62, 207, 178, .04);
  border: 1px solid rgba(62, 207, 178, .1);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.rec-cover {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0d2035, #0a1828);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  border: 1px solid var(--border2);
}

/* ── Comment ── */
.cmt {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  background: rgba(220, 232, 245, .025);
  border-radius: 10px;
  border-left: 2px solid rgba(62, 207, 178, .2);
}

/* ── Group card ── */
.gcard {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 18px 18px 16px;
  transition: all .2s;
}

.gcard:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(62, 207, 178, .06);
}

/* ── List item ── */
.litem {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all .15s;
}

.litem:hover {
  border-color: var(--border);
  background: var(--bg3);
}

/* ── Quote card ── */
.qcard {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s;
}

.qcard:hover {
  border-color: var(--border);
}

.qbg {
  position: absolute;
  top: -10px;
  left: 12px;
  font-family: 'Merriweather', serif;
  font-size: 6rem;
  color: rgba(62, 207, 178, .05);
  line-height: 1;
  pointer-events: none;
}

.section-head-copy {
  min-width: 0;
}

.section-head-subtitle {
  font-size: .82rem;
  color: var(--text4);
  margin-top: 2px;
}

.quote-composer-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}

.quote-composer-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.quote-composer-input {
  flex: 1;
  resize: none;
  font-style: italic;
  font-size: .93rem;
}

.quote-composer-actions {
  display: flex;
  gap: 7px;
  padding-left: 43px;
}

.quote-composer-source {
  flex: 1;
  font-size: .84rem;
}

.quote-card-text {
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.78;
  margin-bottom: 14px;
  position: relative;
}

.quote-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.quote-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Modal ── */
.moverlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .18s ease;
}

.mbox {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  animation: fadeUp .25s ease;
}

.mhandle {
  display: flex;
  justify-content: center;
  padding: 12px 0 0;
}

.mhandle span {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(220, 232, 245, .1);
  display: block;
}

.mhead {
  padding: 10px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border3);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 2;
}

.mbody {
  padding: 20px 20px 36px;
}

/* ── Drop zone ── */
.dropzone {
  border: 2px dashed rgba(220, 232, 245, .1);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--teal);
  background: var(--tealg);
}

/* ── Toggle ── */
.toggle {
  display: flex;
  background: rgba(220, 232, 245, .04);
  border-radius: 10px;
  padding: 4px;
  gap: 3px;
}

.tgl {
  flex: 1;
  padding: 9px 0;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text3);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}

.tgl.on {
  background: var(--teal);
  color: var(--bg);
}

/* ── Inner tabs ── */
.itabs {
  display: flex;
  border-bottom: 1px solid var(--border3);
  margin-bottom: 16px;
}

.itab {
  padding: 8px 15px;
  border: none;
  background: transparent;
  color: var(--text4);
  font-size: .82rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}

.itab.on {
  color: var(--teal);
  font-weight: 700;
  border-bottom-color: var(--teal);
}

/* ── Emoji/Icon picker ── */
.epicker {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.ep {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: rgba(220, 232, 245, .03);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ep.on {
  border-color: var(--teal);
  background: rgba(62, 207, 178, .12);
}

/* ── Misc ── */
.row {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.lbl {
  font-size: .72rem;
  color: var(--text4);
  font-weight: 600;
  margin-bottom: 5px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.sec-title {
  font-family: 'Merriweather', serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.3px;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text4);
}

.empty-ico {
  font-size: 3rem;
  margin-bottom: 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.stat-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.wl-box {
  background: rgba(62, 207, 178, .06);
  border: 1px solid rgba(62, 207, 178, .15);
  border-radius: 10px;
  padding: 13px;
}

.wl-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  padding: 3px 0;
  color: var(--text2);
}

.err-box {
  display: none;
  color: var(--coral);
  font-size: .82rem;
  background: rgba(232, 98, 74, .08);
  border: 1px solid rgba(232, 98, 74, .2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}

.badge {
  font-size: .64rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: .3px;
}

.badge-teal {
  background: rgba(62, 207, 178, .1);
  border: 1px solid rgba(62, 207, 178, .25);
  color: var(--teal);
}

.badge-coral {
  background: rgba(232, 98, 74, .1);
  border: 1px solid rgba(232, 98, 74, .25);
  color: var(--coral);
}

.badge-violet {
  background: rgba(139, 107, 219, .1);
  border: 1px solid rgba(139, 107, 219, .25);
  color: var(--violet);
}

.badge-gold {
  background: rgba(240, 192, 96, .1);
  border: 1px solid rgba(240, 192, 96, .25);
  color: var(--gold);
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 9000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.toast-item {
  background: var(--bg3);
  border-radius: 10px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  max-width: 280px;
  animation: fadeUp .25s ease;
  border: 1px solid var(--border);
}

/* ── Lightbox ── */
#lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .96);
  align-items: center;
  justify-content: center;
}

#lb.on {
  display: flex;
}

#lb img {
  max-width: 96vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
}

.lb-btn {
  position: fixed;
  background: rgba(255, 255, 255, .08);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 1;
  transition: background .15s;
}

.lb-btn-prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-btn-next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-btn-close {
  top: 14px;
  right: 14px;
  font-size: .9rem;
}

.lb-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .4);
  font-size: .8rem;
  pointer-events: none;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, .18);
}

/* ── Streak badge ── */
.streak-fire {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(240, 192, 96, .1);
  border: 1px solid rgba(240, 192, 96, .2);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold);
}

/* ── Chapter journal ── */
.journal-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 16px;
  transition: all .2s;
}

.journal-card:hover {
  border-color: var(--border);
}

/* ── Auth screen glow ── */
.auth-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 30% 40%, rgba(62, 207, 178, .06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 70% 70%, rgba(139, 107, 219, .05) 0%, transparent 60%);
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-panel {
  width: 100%;
  max-width: 420px;
  animation: fadeUp .45s ease;
}

.auth-brand {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo {
  font-family: 'Merriweather', serif;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1;
}

.auth-logo em {
  color: var(--teal);
  font-style: italic;
  text-shadow: 0 0 30px rgba(62, 207, 178, .5);
}

.auth-subtitle {
  margin-top: 10px;
  color: var(--text3);
  font-size: .9rem;
  letter-spacing: .2px;
}

.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}

.auth-user-row[hidden] {
  display: none !important;
}

.visually-hidden-input {
  display: none !important;
}

.feed-control-select {
  width: auto;
  font-size: .82rem;
  padding: 7px 10px;
  border-radius: 20px;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.groups-shell {
  max-width: 860px;
  margin: 0 auto;
}

.groups-pending-slot {
  margin-bottom: 14px;
}

.groups-pending-slot:empty {
  display: none;
}

.groups-pending-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid rgba(62, 207, 178, .16);
  background: rgba(62, 207, 178, .05);
}

.groups-pending-copy {
  min-width: 0;
}

.groups-pending-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text2);
}

.groups-pending-meta {
  margin-top: 3px;
  font-size: .77rem;
  color: var(--text4);
}

.groups-content {
  min-height: 220px;
}

.groups-search-input {
  height: 46px;
  border-radius: 14px;
}

.story-comment-submit {
  padding: 9px 14px;
  font-size: .82rem;
}

.icon-picker-accent {
  color: var(--teal);
}

.icon-picker-accent-text {
  color: var(--text);
}

.feed-rec-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.feed-rec-link-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.feed-rec-genre {
  font-size: .73rem;
  color: var(--teal);
  margin: 0;
}

.feed-rec-link {
  font-size: .71rem;
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  background: var(--tealg);
  margin-top: 2px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(62, 207, 178, .15);
  text-decoration: none;
  line-height: 1;
}

.feed-story-body {
  font-size: .9rem;
  line-height: 1.72;
  color: var(--text2);
  margin-bottom: 12px;
}

.auth-toggle {
  margin-bottom: 22px;
}

.auth-submit {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border-radius: 12px;
  font-size: .93rem;
}

.auth-switch-copy {
  margin-top: 14px;
  text-align: center;
  font-size: .8rem;
  color: var(--text4);
}

.auth-switch-btn {
  color: var(--teal);
  cursor: pointer;
  font-weight: 600;
  margin-left: 4px;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
}

.auth-footnote {
  margin-top: 14px;
  text-align: center;
  font-size: .73rem;
  color: var(--text4);
}

.empty-title {
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: var(--text3);
}

.empty-copy {
  font-size: .87rem;
  margin-bottom: 20px;
  color: var(--text4);
}

.empty-actions:empty {
  display: none;
}

.feed-scope-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(62, 207, 178, .05);
  border: 1px solid rgba(62, 207, 178, .14);
}

.feed-scope-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-scope-name {
  font-size: .84rem;
  color: var(--text2);
}

.feed-scope-clear {
  padding: 8px 12px;
  border-radius: 999px;
}

.groups-search-input {
  margin-bottom: 16px;
}

.modal-shell-close {
  background: rgba(220, 232, 245, .07);
  border: 1px solid var(--border2);
  color: var(--text3);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .15s, border-color .15s;
}

.modal-shell-close:hover {
  background: rgba(220, 232, 245, .12);
  border-color: var(--border);
}

.modal-shell-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-shell-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.modal-shell-header-actions:empty {
  display: none;
}

.modal-shell-header-back {
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: rgba(220, 232, 245, .07);
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.modal-shell-header-back:hover {
  background: rgba(220, 232, 245, .12);
  border-color: var(--border);
}

.avatar-template {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-image-template {
  background: #000;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.group-image-box {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(220, 232, 245, .04);
  flex-shrink: 0;
}

.group-image-box-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.group-image-box-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Responsive ── */
@media(max-width:640px) {
  #tab-row {
    display: none;
  }

  #mbar {
    display: flex;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }
}

@media(min-width:641px) {
  #mbar {
    display: none !important;
  }
}

/* ── Profile avatar custom icons ── */
.av-frame {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ── Icon picker modal ── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.icon-opt {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1.5px solid var(--border2);
  background: rgba(220, 232, 245, .03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all .15s;
}

.icon-opt:hover {
  border-color: var(--teal);
  background: var(--tealg);
}

.icon-opt.sel {
  border-color: var(--teal);
  background: rgba(62, 207, 178, .15);
  box-shadow: 0 0 0 2px rgba(62, 207, 178, .2);
}

.color-opt {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
}

.color-opt.sel {
  border-color: #fff;
  transform: scale(1.15);
}

/* ── Image upload avatar ── */
.av-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(62, 207, 178, .04);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.av-upload-zone:hover {
  border-color: var(--teal);
  background: rgba(62, 207, 178, .1);
}

.av-upload-zone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.av-upload-hint {
  font-size: .65rem;
  color: var(--text4);
  text-align: center;
  line-height: 1.3;
  padding: 4px;
}

.group-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 18px;
  width: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(62, 207, 178, .04);
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.group-upload-zone:hover {
  border-color: var(--teal);
  background: rgba(62, 207, 178, .09);
}

.group-upload-zone img {
  width: 100%;
  min-height: 120px;
  max-height: 190px;
  object-fit: cover;
  display: block;
}

.group-upload-hint {
  font-size: .76rem;
  color: var(--text4);
  text-align: center;
  line-height: 1.5;
  padding: 8px 10px;
}

/* ── Report modal ── */
.report-reason {
  display: grid;
  grid-template-columns: 18px 24px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: rgba(220, 232, 245, .03);
  border: 1px solid var(--border2);
  border-radius: 14px;
  cursor: pointer;
  transition: all .15s;
}

.report-reason:hover {
  border-color: var(--coral);
  background: rgba(232, 98, 74, .05);
}

.report-reason.sel {
  border-color: var(--coral);
  background: rgba(232, 98, 74, .08);
  box-shadow: 0 0 0 1px rgba(232, 98, 74, .12) inset;
}

.report-reason input[type=radio] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.report-reason-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(220, 232, 245, .28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.report-reason-mark::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: background .15s;
}

.report-reason.sel .report-reason-mark {
  border-color: var(--coral);
  background: rgba(232, 98, 74, .08);
}

.report-reason.sel .report-reason-mark::after {
  background: var(--coral);
}

.report-reason-icon {
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
}

.report-reason-label {
  font-size: .98rem;
  font-weight: 700;
  color: var(--text2);
  line-height: 1.35;
}

/* ── User report badge ── */
.user-reported {
  border-color: rgba(232, 98, 74, .3) !important;
}


/* ── Profile modal actions ── */
.profile-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.profile-act {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  padding: 10px 8px;
  white-space: normal;
}

.profile-act .ico {
  display: block;
  font-size: 1rem;
  line-height: 1;
  margin-bottom: 6px;
}

.profile-act .txt {
  display: block;
  font-size: .8rem;
  font-weight: 600;
}

@media(max-width:640px) {
  .profile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Voting UI states */
.vote-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  background: rgba(220, 232, 245, .04);
  border: 1px solid var(--border2);
  color: var(--text3);
}

.vote-btn.active-up {
  background: rgba(62, 207, 178, .18);
  border-color: rgba(62, 207, 178, .3);
  color: var(--teal);
}

.vote-btn.active-down {
  background: rgba(232, 98, 74, .16);
  border-color: rgba(232, 98, 74, .3);
  color: var(--coral);
}


/* Arrow-only voting */
.vote-btn {
  min-width: 52px;
  justify-content: center;
  padding: 6px 12px;
}

.vote-btn .label {
  display: none;
}

.vote-count {
  min-width: 46px;
  text-align: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--teal);
}


/* Split voting layout */
.vote-pair {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vote-btn {
  min-width: 40px;
  height: 32px;
  padding: 0 10px;
  justify-content: center;
}

.vote-count {
  min-width: 40px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 20px;
  background: rgba(220, 232, 245, .04);
  border: 1px solid var(--border2);
  font-size: .8rem;
  font-weight: 700;
}

.vote-count.up {
  color: var(--teal);
}

.vote-count.down {
  color: var(--coral);
}


/* Single-pill voting UI */
.vote-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vote-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: rgba(220, 232, 245, .04);
  color: var(--text3);
  font-size: .84rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.vote-pill.up.active,
.vote-pill.up {
  border-color: rgba(62, 207, 178, .35);
}

.vote-pill.down.active,
.vote-pill.down {
  border-color: rgba(232, 98, 74, .28);
}

.vote-pill.up.active {
  background: rgba(62, 207, 178, .14);
  color: var(--teal);
}

.vote-pill.down.active {
  background: rgba(232, 98, 74, .14);
  color: var(--coral);
}

.vote-pill:not(.active).up {
  background: rgba(220, 232, 245, .04);
  color: var(--text3);
}

.vote-pill:not(.active).down {
  background: rgba(220, 232, 245, .04);
  color: var(--text3);
}

.vote-pill .arrow {
  font-size: .9rem;
  line-height: 1;
}

.vote-pill .count {
  line-height: 1;
}


/* framework cleanup */
body {
  font-family: 'Inter', sans-serif;
}

.serif,
#logo,
.sec-title,
.brand-serif {
  font-family: 'Merriweather', serif;
}

.btn {
  border-radius: 999px;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), #61e0c7);
  border: none;
  color: #06211c;
}

.btn-outline-secondary,
.btn-outline-danger {
  border-color: var(--border2);
}

.form-control,
.form-select {
  background: rgba(220, 232, 245, .04);
  border: 1px solid var(--border2);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  background: rgba(220, 232, 245, .06);
  border-color: rgba(62, 207, 178, .35);
  box-shadow: 0 0 0 .2rem rgba(62, 207, 178, .08);
  color: var(--text);
}

.card {
  background: transparent;
  border: none;
}

.tab i,
.mbtab i {
  font-size: .85rem;
  vertical-align: -.04em;
}



/* Android / small-screen responsive patch */
@media (max-width: 768px) {
  #nav-row {
    height: auto;
    min-height: 58px;
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  #logo {
    font-size: 1.25rem;
  }

  #srch-wrap {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }

  #nav-right {
    margin-left: auto;
    gap: 6px;
  }

  #main {
    padding: 16px 12px 90px;
  }

  .sec-head {
    align-items: flex-start;
  }

  .sec-head>div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .sec-head select,
  .sec-head .btn,
  .sec-head .btn-primary {
    width: 100%;
    max-width: none;
  }

  .card-head,
  .card-body,
  .card-foot,
  .litem,
  .qcard,
  .mbody {
    padding-left: 12px;
    padding-right: 12px;
  }

  .litem {
    gap: 10px;
  }

  .vote-wrap {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .vote-pill {
    min-width: 64px;
    height: 32px;
    padding: 0 12px;
    font-size: .8rem;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .icon-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  #nav-row {
    padding: 10px 10px;
  }

  #logo {
    font-size: 1.12rem;
  }

  #main {
    padding: 14px 10px 86px;
  }

  .sec-title {
    font-size: 1.08rem;
  }

  .card-head {
    gap: 8px;
  }

  .card-foot {
    gap: 8px;
  }

  .act {
    padding: 6px 10px;
    font-size: .76rem;
  }

  .vote-pill {
    min-width: 58px;
    padding: 0 10px;
    font-size: .76rem;
  }

  .litem {
    display: grid;
    grid-template-columns: 32px 36px 1fr;
    align-items: center;
  }

  .litem .vote-wrap {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .qcard {
    padding: 16px 12px;
  }

  .qbg {
    font-size: 4.5rem;
    top: -6px;
  }

  .mbox {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
  }

  .icon-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}



/* Keep navbar visible on narrow screens */
#tab-row {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: nowrap;
}

#tab-row::-webkit-scrollbar {
  display: none;
}

#tab-row .tab {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  #app-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(10px);
  }

  #nav-row {
    align-items: center;
  }

  #tab-row {
    width: 100%;
    padding-bottom: 2px;
  }

  #tab-row .tab {
    min-height: 38px;
    padding: 8px 10px;
    font-size: .8rem;
  }
}

@media (max-width: 480px) {
  #tab-row .tab {
    padding: 8px 9px;
    font-size: .78rem;
  }
}



/* Center navbar tabs */
#tab-row {
  justify-content: center;
}

@media (max-width: 768px) {
  #tab-row {
    justify-content: flex-start;
  }
}



/* Tighten logo and search spacing */
#nav-row {
  gap: 10px;
}

#logo {
  margin-right: 0;
}

#srch-wrap {
  margin-left: 0;
}

@media(max-width:820px) {
  #srch-wrap {
    max-width: none;
  }
}

@media(max-width:640px) {
  #nav-row {
    gap: 8px;
    height: 58px;
  }

  #srch-wrap {
    max-width: none;
    order: 3;
    width: 100%;
    margin: 6px 0 10px;
  }

  #app-nav {
    padding-bottom: 8px;
  }
}

.ghost-mini {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: rgba(220, 232, 245, .04);
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, transform .16s ease;
}

.ghost-mini:hover {
  color: var(--teal);
  border-color: rgba(62, 207, 178, .35);
  transform: translateY(-1px);
}

.ghost-mini.danger:hover {
  color: var(--coral);
  border-color: rgba(232, 98, 74, .32);
}

.story-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font: inherit;
  font-family: 'Merriweather', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.story-link-btn:hover {
  color: var(--teal);
}

.story-link-disc {
  margin-bottom: 10px;
}

.story-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.story-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.story-top-copy,
.story-comment-copy,
.story-comment-compose-copy {
  flex: 1;
  min-width: 0;
}

.story-emoji {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(62, 207, 178, .08);
  border: 1px solid rgba(62, 207, 178, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  flex-shrink: 0;
}

.story-title {
  font-family: 'Merriweather', serif;
  font-size: 1.4rem;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: .76rem;
  color: var(--text4);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.story-meta-sep {
  opacity: .4;
}

.story-meta-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(139, 107, 219, .12);
  color: #c7b9ff;
  border: 1px solid rgba(139, 107, 219, .22);
}

.story-meta-pill-alt {
  background: rgba(62, 207, 178, .1);
  border-color: rgba(62, 207, 178, .22);
  color: var(--teal);
}

.story-meta-pill-warn {
  background: rgba(232, 98, 74, .1);
  border-color: rgba(232, 98, 74, .22);
  color: var(--coral);
}

.story-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  min-width: 0;
}

.story-inline-link,
.story-text-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
}

.story-inline-link:hover,
.story-text-btn:hover {
  color: var(--text);
}

.story-author-link {
  font-weight: 700;
}

.story-subtle {
  font-size: .76rem;
  color: var(--text4);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.story-section,
.story-comments {
  border: 1px solid var(--border);
  background: rgba(220, 232, 245, .03);
  border-radius: 16px;
  padding: 16px;
}

.story-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.story-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 2px;
}

.story-top-copy {
  flex: 1;
  min-width: 0;
}

.story-body {
  color: var(--text2);
  line-height: 1.8;
  font-size: .92rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.story-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.story-gallery-item {
  border: 1px solid var(--border2);
  background: rgba(15, 22, 33, .9);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  min-height: 140px;
}

.story-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  max-width: 100%;
}

.story-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 11px 15px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--teal);
  border: 1px solid rgba(62, 207, 178, .2);
  background: rgba(62, 207, 178, .06);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px 0;
  border-top: 1px solid var(--border3);
}

.story-votes,
.story-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.story-comment-count {
  margin-left: auto;
}

.story-comments-head {
  font-family: 'Merriweather', serif;
  font-size: 1rem;
  margin-bottom: 14px;
}

.story-comment-compose {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(15, 22, 33, .72);
  border: 1px solid var(--border3);
}

.story-comment-compose-copy {
  flex: 1;
  min-width: 0;
}

.story-comment-compose textarea {
  min-height: 108px;
  resize: vertical;
  width: 100%;
}

.story-comment-compose-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.story-comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-empty {
  border: 1px dashed var(--border3);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  color: var(--text4);
}

.story-comment {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 22, 33, .9);
  border: 1px solid var(--border3);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.story-comment-head,
.story-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.icon-picker-preview-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.icon-picker-preview {
  display: inline-block;
  position: relative;
}

.icon-picker-tabs {
  margin-bottom: 14px;
}

.icon-picker-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.icon-picker-actions .btn {
  flex: 1;
}

.icon-picker-color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-picker-initials-note {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(220, 232, 245, .04);
  border-radius: 10px;
  border: 1px solid var(--border2);
}

.icon-picker-note-icon {
  font-size: 1.2rem;
}

.icon-picker-note-text {
  font-size: .85rem;
  color: var(--text2);
}

.journal-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journal-history-item {
  padding: 10px 12px;
  background: rgba(220, 232, 245, .04);
  border-radius: 8px;
  border-left: 2px solid var(--teal);
}

.journal-history-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.journal-history-chapter {
  font-size: .8rem;
  font-weight: 700;
  color: var(--teal);
}

.journal-history-time {
  font-size: .7rem;
  color: var(--text4);
}

.journal-history-rating {
  font-size: .78rem;
  color: var(--gold);
  margin-left: auto;
}

.journal-history-note {
  font-size: .83rem;
  color: var(--text2);
  margin: 0;
}

.story-comment-head {
  margin-bottom: 6px;
  font-size: .76rem;
  color: var(--text4);
}

.story-comment-body {
  color: var(--text2);
  line-height: 1.65;
  font-size: .88rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.story-empty {
  border: 1px dashed var(--border2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: var(--text4);
  font-size: .84rem;
}

@media (max-width: 640px) {
  .story-top {
    flex-direction: column;
  }

  .story-emoji {
    width: 52px;
    height: 52px;
  }

  .story-title {
    font-size: 1.2rem;
  }

  .story-comment-compose {
    flex-direction: column;
  }

  .story-comment-compose-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* start feed polish */
.feed-card {
  scroll-margin-top: 84px;
}

.feed-meta-row {
  font-size: .71rem;
  color: var(--text4);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1px;
}

.feed-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.feed-post-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
  color: var(--text);
}

.feed-post-body {
  font-size: .92rem;
  line-height: 1.78;
  color: var(--text2);
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-meta-accent {
  color: var(--teal);
}

.feed-story-panel {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 27, 30, .88), rgba(10, 24, 31, .74));
  border: 1px solid rgba(62, 207, 178, .13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
}

.feed-story-cover {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(24, 46, 71, .96);
  border: 1px solid rgba(62, 207, 178, .1);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .18);
}

.feed-story-copy {
  min-width: 0;
  flex: 1;
}

.feed-story-title {
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(220, 232, 245, .34);
  margin-bottom: 6px;
}

.feed-story-genre {
  font-size: .95rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 10px;
}

.feed-story-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(62, 207, 178, .08);
  border: 1px solid rgba(62, 207, 178, .18);
  color: var(--text2);
  text-decoration: none;
  font-size: .82rem;
}

.feed-story-chip:hover {
  color: var(--text);
  border-color: rgba(62, 207, 178, .34);
}

.feed-story-media {
  margin-top: 14px;
}

.feed-tag-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.feed-actions-end {
  margin-left: auto;
  display: flex;
  gap: 2px;
  align-items: center;
}

.feed-comments-box {
  padding: 12px 14px;
  border-top: 1px solid var(--border3);
}

.feed-comment-compose {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.feed-comment-compose-main {
  flex: 1;
  display: flex;
  gap: 7px;
}

.feed-comment-compose-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#feed-load-more,
.feed-load-more {
  text-align: center;
  padding: 16px 0 8px;
  color: var(--text4);
  font-size: .78rem;
}

@media (hover: hover) and (pointer: fine) {
  .feed-card:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 768px) {
  .feed-story-panel {
    padding: 16px;
    gap: 12px;
  }

  .feed-story-cover {
    width: 62px;
    height: 62px;
    font-size: 1.7rem;
  }

  .feed-head-actions {
    align-self: flex-start;
  }

  .feed-post-body {
    font-size: .88rem;
    line-height: 1.7;
  }

  .feed-comments-box {
    padding: 12px;
  }

  .feed-comment-compose-main {
    flex-direction: column;
  }

  .feed-comment-compose-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .feed-actions-end {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .feed-card {
    margin-bottom: 14px;
  }

  .feed-story-panel {
    padding: 14px;
    gap: 10px;
  }

  .feed-story-cover {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    font-size: 1.45rem;
  }

  .feed-story-title {
    font-size: .98rem;
  }

  .feed-story-chip {
    width: 100%;
    justify-content: center;
  }

  .feed-comments-box {
    padding: 10px;
  }

  .feed-comment-compose {
    gap: 8px;
  }

  .feed-comment-compose-actions .btn {
    flex: 1;
  }
}
/* end feed polish */

/* start list polish */
.list-create-modal {
  gap: 12px;
}

.list-modal-label {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  color: var(--text4);
  margin-bottom: 8px;
}

.list-icon-grid {
  gap: 8px;
}

.list-icon-grid .ep {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.08rem;
}

.list-name-input,
.list-story-input {
  min-height: 46px;
  font-size: .97rem;
  border-radius: 12px;
}

.list-create-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.list-add-btn {
  flex-shrink: 0;
  min-width: 76px;
  min-height: 46px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.list-submit-btn {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
}

.list-entry-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  background: rgba(220, 232, 245, .035);
  border: 1px solid var(--border3);
  border-radius: 10px;
}

.list-entry-index {
  color: var(--teal);
  font-size: .98rem;
  font-weight: 700;
}

.list-entry-title {
  flex: 1;
  min-width: 0;
  font-size: .98rem;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-entry-remove {
  background: none;
  border: none;
  color: var(--text4);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
}

.list-entry-remove:hover {
  color: var(--coral);
}

.list-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.list-detail-meta {
  font-size: .82rem;
  color: var(--text4);
}

.list-detail-votes {
  display: flex;
  gap: 6px;
  align-items: center;
}

.list-detail-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.list-detail-item {
  padding: 10px 13px;
  background: rgba(220, 232, 245, .04);
  border: 1px solid var(--border3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-detail-index {
  color: var(--teal);
  min-width: 22px;
}

.list-detail-title {
  font-size: .94rem;
  font-weight: 600;
}

.litem-modern {
  background: linear-gradient(180deg, rgba(12, 24, 40, .96), rgba(10, 19, 31, .97));
  border: 1px solid rgba(62, 207, 178, .12);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}

.litem-modern:hover {
  border-color: rgba(62, 207, 178, .22);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.list-rank-pill,
.list-emoji-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-rank-pill {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(220, 232, 245, .04);
  color: var(--text2);
  font-size: .92rem;
  font-weight: 700;
}

.list-emoji-pill {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(62, 207, 178, .05);
  font-size: 1.35rem;
}

.list-copy {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-size: .98rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.list-subtitle {
  font-size: .76rem;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-vote-pill {
  min-width: 78px;
  height: 36px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .list-create-row {
    flex-direction: column;
    align-items: stretch;
  }

  .list-add-btn {
    width: 100%;
  }

  .litem-modern {
    padding: 12px;
    gap: 10px;
  }

  .list-vote-pill {
    min-width: 68px;
    height: 34px;
  }
}

@media (max-width: 480px) {
  .litem-modern {
    display: grid;
    grid-template-columns: 34px 38px minmax(0, 1fr);
    align-items: center;
  }

  .litem-modern .list-vote-pill {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: 8px;
  }
}
/* end list polish */

/* start discover templates */
.discover-panel {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.discover-shell {
  max-width: 900px;
  margin: 0 auto;
}

.discover-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.discover-intro {
  font-size: .82rem;
  color: var(--text4);
  margin-bottom: 18px;
}

.discover-mood-panel {
  padding: 18px;
}

.discover-mood-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.discover-mood-item {
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border2);
  background: rgba(220, 232, 245, .03);
  cursor: pointer;
  transition: .16s;
}

.discover-mood-item:hover {
  border-color: var(--border);
  background: rgba(220, 232, 245, .05);
}

.discover-mood-emoji {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.discover-mood-label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--text2);
}

.discover-mood-genres {
  font-size: .71rem;
  color: var(--text4);
  margin-top: 2px;
}

.discover-favorites-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.discover-panel-title {
  font-size: .98rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.discover-panel-subtitle {
  font-size: .74rem;
  color: var(--text4);
}

.discover-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.discover-filter-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: rgba(220, 232, 245, .03);
  color: var(--text3);
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  transition: .16s;
}

.discover-filter-btn.active {
  border-color: rgba(62, 207, 178, .28);
  background: var(--tealg);
  color: var(--teal);
}

.discover-favorites-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discover-empty-message {
  font-size: .8rem;
  color: var(--text4);
}

.discover-favorite-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px;
  background: rgba(220, 232, 245, .03);
  border-radius: 9px;
  cursor: pointer;
}

.discover-rank {
  font-size: 1.2rem;
  font-weight: 900;
  color: rgba(62, 207, 178, .2);
  width: 20px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  flex-shrink: 0;
}

.discover-emoji {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.discover-favorite-copy {
  flex: 1;
  min-width: 0;
}

.discover-favorite-title {
  font-size: .87rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discover-favorite-meta {
  font-size: .73rem;
  color: var(--text4);
}

.discover-favorite-votes {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: .79rem;
  font-weight: 700;
}

.discover-vote-up {
  color: var(--teal);
}

.discover-vote-down {
  color: var(--text4);
}

.discover-legal-box {
  background: rgba(62, 207, 178, .04);
  border: 1px solid rgba(62, 207, 178, .12);
  border-radius: 12px;
  padding: 14px 16px;
}

.discover-legal-title {
  font-size: .83rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
}

.discover-legal-copy {
  font-size: .77rem;
  color: var(--text3);
  line-height: 1.6;
  margin: 0;
}

.discover-tags-panel .active-tags-title {
  margin-bottom: 4px;
}

.discover-tags-panel .active-tags-note {
  margin-bottom: 10px;
}

.discover-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discover-tag-chip {
  background: var(--tealg);
  border: 1px solid rgba(62, 207, 178, .18);
  color: var(--teal);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.discover-tag-count {
  opacity: .6;
  font-size: .7rem;
}

@media (max-width: 640px) {
  .discover-shell {
    max-width: none;
  }

  .discover-mood-grid {
    grid-template-columns: 1fr;
  }

  .discover-favorite-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .discover-favorite-votes {
    width: 100%;
    justify-content: flex-end;
  }
}
/* end discover templates */

/* start group templates */
.gcard-template {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  min-height: 266px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 22, 34, .94), rgba(9, 18, 28, .98));
  border: 1px solid var(--border2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
}

.group-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.group-card-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.group-card-image {
  flex-shrink: 0;
  width: 62px;
  height: 62px;
}

.group-card-copy {
  min-width: 0;
  flex: 1;
}

.group-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
  margin-bottom: 4px;
}

.group-card-desc {
  font-size: .8rem;
  color: var(--text3);
  margin: 6px 0 0;
  line-height: 1.6;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.group-card-menu {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: rgba(220, 232, 245, .04);
  color: var(--text2);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s, color .15s, background .15s;
}

.group-card-menu:hover {
  border-color: var(--border);
  color: var(--text1);
}

.group-card-menu.has-pending {
  border-color: rgba(62, 207, 178, .24);
  background: rgba(62, 207, 178, .08);
}

.group-card-menu::after {
  display: none;
}

.group-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.group-card-badges:empty {
  display: none;
}

.group-card-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: .75rem;
  color: var(--text4);
}

.group-card-actions {
  display: flex;
  gap: 0;
  align-items: stretch;
  margin-top: auto;
}

.group-card-view {
  flex: 1 1 auto;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .groups-shell {
    max-width: none;
  }

  .groups-pending-notice {
    flex-direction: column;
    align-items: stretch;
  }

  .groups-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .group-card-actions {
    flex-direction: column;
  }
}
/* end group templates */

/* start feed templates */
.feed-card-template {
  animation: fadeUp .35s ease both;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.feed-body-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feed-author-meta {
  flex: 1;
  min-width: 0;
}

.feed-author-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.feed-author-name {
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  color: var(--teal);
  font-family: 'Outfit', sans-serif;
}

.feed-meta-row {
  font-size: .71rem;
  color: var(--text4);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1px;
}

.feed-meta-sep {
  opacity: .4;
}

.feed-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}


.feed-story-submeta {
  font-size: .73rem;
  color: var(--teal);
  margin: 3px 0;
}

.feed-inline-link {
  font-size: .71rem;
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--tealg);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(62, 207, 178, .15);
  transition: color .15s;
}

.feed-inline-link:hover {
  color: var(--teal);
}

.feed-body-copy {
  font-size: .9rem;
  line-height: 1.72;
  color: var(--text2);
  margin-bottom: 12px;
}

.feed-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.feed-foot-end {
  margin-left: auto;
  display: flex;
  gap: 2px;
  align-items: center;
}

.feed-quick-comments {
  background: none;
  border: none;
  color: var(--text4);
  font-size: .78rem;
  padding: 5px 7px;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 5px;
}

.feed-quick-comments:hover {
  color: var(--text2);
}

.feed-comments-box {
  border-top: 1px solid var(--border3);
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, rgba(12, 19, 29, .62), rgba(12, 19, 29, .3));
}

.feed-comment-composer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.feed-comment-editor {
  flex: 1;
  display: flex;
  gap: 10px;
}

.feed-comment-input {
  flex: 1;
  resize: none;
  font-size: .87rem;
  min-height: 92px;
}

.feed-comment-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-comment-empty {
  font-size: .83rem;
  color: var(--text4);
  text-align: center;
  padding: 10px 0 6px;
}

.feed-comments-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.feed-comment-copy {
  flex: 1;
  min-width: 0;
}

.feed-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.feed-comment-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--teal);
  cursor: pointer;
}

.feed-comment-time {
  font-size: .7rem;
  color: var(--text4);
}

.feed-comment-body {
  font-size: .87rem;
  color: var(--text2);
  line-height: 1.65;
}

.feed-comment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.feed-comment-report {
  background: none;
  border: none;
  color: var(--text4);
  font-size: .7rem;
  cursor: pointer;
  padding: 0 4px;
  transition: color .15s;
}

.feed-comment-report:hover {
  color: var(--coral);
}

.spoiler-wrap {
  border-radius: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(232, 98, 74, .14);
  background: rgba(15, 22, 33, .35);
}

.spoiler-overlay {
  gap: 10px;
  background: rgba(8, 14, 20, .58);
  backdrop-filter: blur(3px);
}

.spoiler-badge {
  padding: 7px 14px;
  border-radius: 8px;
}

.spoiler-overlay .story-subtle,
.spoiler-overlay .spoiler-copy {
  color: rgba(255,255,255,.7);
}

@media (max-width: 640px) {
  .feed-comment-editor {
    flex-direction: column;
  }

  .feed-comment-buttons {
    width: 100%;
    flex-direction: row;
  }

  .feed-comment-buttons .btn {
    flex: 1;
  }

  .feed-foot-end {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}
/* end feed templates */

/* start modal template cleanup */
.modal-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-copy {
  font-size: .82rem;
  color: var(--text3);
  line-height: 1.65;
}

.modal-footnote {
  font-size: .74rem;
  color: var(--text4);
  text-align: center;
  line-height: 1.6;
}

.modal-submit-btn {
  padding: 11px;
  border-radius: 10px;
}

.modal-textarea {
  resize: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  text-align: center;
}

.stat-card {
  background: rgba(220, 232, 245, .04);
  border-radius: 10px;
  padding: 14px 6px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal);
}

.stat-label {
  font-size: .76rem;
  color: var(--text4);
  margin-top: 2px;
}

.profile-modal-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.profile-modal-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.profile-modal-meta {
  font-size: .8rem;
  color: var(--text4);
  margin-top: 2px;
}

.profile-modal-streak {
  margin-top: 5px;
}

.profile-modal-bio {
  font-size: .88rem;
  color: var(--text2);
  line-height: 1.65;
  background: rgba(220, 232, 245, .04);
  border-radius: 8px;
  padding: 12px 13px;
}

.profile-section-label {
  font-size: .76rem;
  color: var(--text4);
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.profile-post-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.profile-post-row {
  padding: 9px 12px;
  background: rgba(220, 232, 245, .04);
  border: 1px solid var(--border3);
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.profile-post-emoji {
  font-size: 1.1rem;
}

.profile-post-title {
  font-size: .88rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-post-score {
  font-size: .74rem;
  color: var(--teal);
}

.profile-avatar-editor {
  position: relative;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.profile-avatar-edit-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  color: var(--bg);
  border: 2px solid var(--bg2);
}

.spoiler-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border3);
  margin-top: 10px;
}

.spoiler-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .84rem;
  color: var(--text2);
}

.spoiler-switch {
  position: relative;
  width: 38px;
  height: 22px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.spoiler-switch .sw-track {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: rgba(220, 232, 245, .1);
  border: 1px solid var(--border2);
  transition: background .2s;
}

.spoiler-switch .sw-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.spoiler-switch.on .sw-track {
  background: var(--coral);
}

.spoiler-switch.on .sw-thumb {
  left: 18px;
}

.spoiler-help {
  font-size: .73rem;
  color: var(--text4);
}

.post-image-drop-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.post-image-drop-title {
  font-size: .85rem;
  color: var(--text3);
}

.quote-card-meta-copy {
  font-size: .77rem;
  color: var(--text4);
}

.quote-card-source {
  color: var(--teal);
  font-style: italic;
}

.stack-empty-copy {
  font-size: .8rem;
  color: var(--text4);
}

.group-action-btn {
  flex: 1;
}

.post-image-drop-subtitle {
  font-size: .74rem;
  color: var(--text4);
  margin-top: 4px;
}

.post-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.post-image-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg);
}

.post-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, .7);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: .68rem;
  cursor: pointer;
  line-height: 1;
}

.post-image-count {
  text-align: center;
  font-size: .76rem;
  color: var(--text4);
  margin-top: 7px;
}

.wl-title {
  color: var(--teal);
  margin-bottom: 8px;
}

.wl-icon {
  color: var(--teal);
}

.group-summary-card,
.group-detail-hero,
.group-members-summary,
.group-preview-post,
.member-card {
  background: rgba(220, 232, 245, .04);
  border: 1px solid var(--border3);
  border-radius: 12px;
}

.group-summary-card,
.member-card {
  padding: 12px 14px;
}

.group-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-summary-title,
.group-detail-title {
  font-size: 1rem;
  font-weight: 700;
}

.group-summary-access {
  font-size: .75rem;
  color: var(--text4);
  margin-top: 3px;
}

.action-col,
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-manage-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(220, 232, 245, .03);
  border: 1px solid var(--border3);
}

.group-manage-summary-title {
  font-size: .8rem;
  color: var(--text3);
}

.group-manage-summary-count {
  font-size: .78rem;
  font-weight: 700;
  color: var(--teal);
}

.group-action-btn {
  width: 100%;
  min-height: 46px;
  font-weight: 600;
}

.group-detail-hero,
.group-detail-permissions,
.group-detail-preview {
  padding: 16px;
}

.group-detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.group-detail-copy {
  flex: 1;
  min-width: 0;
}

.group-detail-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.group-detail-title {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.group-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.group-detail-desc {
  font-size: .84rem;
  color: var(--text3);
  line-height: 1.65;
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.group-detail-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .77rem;
  color: var(--text4);
}

.group-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.group-detail-actions .btn {
  flex: 1 1 180px;
  min-height: 48px;
  font-weight: 700;
}

.group-detail-roster {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(220, 232, 245, .045), rgba(220, 232, 245, .03));
  border: 1px solid var(--border3);
  border-radius: 16px;
}

.group-detail-roster-title {
  margin: 0;
}

.group-detail-roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.group-detail-roster-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.group-members-view-all-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
}

.group-role-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.group-role-row-members {
  align-items: start;
}

.group-role-label-wrap {
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.group-role-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.group-role-count {
  font-size: .74rem;
  color: var(--text5);
  line-height: 1.4;
}

.group-role-slot {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.group-role-slot-single {
  display: flex;
}

.group-role-person {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(220, 232, 245, .035);
  border: 1px solid var(--border3);
  border-radius: 14px;
  color: var(--text2);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}

.group-role-person:hover,
.group-role-person:focus-visible {
  border-color: var(--border);
  background: rgba(220, 232, 245, .055);
  transform: translateY(-1px);
}

.group-role-person-avatar {
  flex: 0 0 auto;
}

.group-role-person-copy {
  min-width: 0;
  flex: 1;
}

.group-role-person-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.group-role-person-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text2);
}

.group-role-person-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
}

.group-role-person-meta {
  margin-top: 4px;
  font-size: .76rem;
  color: var(--text4);
  line-height: 1.45;
}

.group-member-chip-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.group-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--border3);
  background: rgba(220, 232, 245, .04);
  color: var(--text2);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}

.group-member-chip:hover,
.group-member-chip:focus-visible {
  border-color: var(--border);
  background: rgba(220, 232, 245, .06);
  transform: translateY(-1px);
}

.group-member-chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
}

.group-member-chip-name {
  font-size: .81rem;
  font-weight: 700;
}

.group-member-chip-more {
  background: rgba(62, 207, 178, .08);
  border-color: rgba(62, 207, 178, .2);
  color: var(--teal);
  font-weight: 700;
}

.group-detail-preview {
  padding-top: 4px;
}

.group-preview-list {
  display: grid;
  gap: 10px;
}

.modal-section-title {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.role-note {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .8rem;
  color: var(--text3);
}

.owner-note {
  background: rgba(240, 192, 96, .06);
  border: 1px solid rgba(240, 192, 96, .16);
}

.moderator-note {
  background: rgba(62, 207, 178, .05);
  border: 1px solid rgba(62, 207, 178, .16);
}

.member-note {
  background: rgba(220, 232, 245, .04);
  border: 1px solid var(--border3);
}

.group-preview-post {
  padding: 14px 16px;
  background: rgba(220, 232, 245, .035);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}

.group-preview-post:hover {
  border-color: var(--border);
  background: rgba(220, 232, 245, .055);
}

.group-preview-post:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(62, 207, 178, .12);
}

.group-preview-post-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.group-preview-post-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text2);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.group-preview-post-time,
.group-preview-post-meta {
  font-size: .76rem;
  color: var(--teal);
}

.group-preview-post-time {
  flex-shrink: 0;
  white-space: nowrap;
}

.group-preview-post-meta {
  margin-top: 4px;
}

.group-preview-post-body {
  font-size: .82rem;
  color: var(--text3);
  margin-top: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 82px;
}

.member-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-card-copy {
  min-width: 0;
}

.member-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.member-card-name {
  font-weight: 600;
  font-size: .87rem;
}

.member-card-meta {
  font-size: .74rem;
  color: var(--text4);
  margin-top: 3px;
}

.member-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-card-note {
  font-size: .73rem;
  color: var(--text4);
}

.member-card-clickable {
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}

.member-card-clickable:hover,
.member-card-clickable:focus-within {
  border-color: var(--border);
  background: rgba(220, 232, 245, .055);
  transform: translateY(-1px);
}

.group-member-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.group-member-search-input-wrap {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border3);
  background: rgba(220, 232, 245, .03);
}

.group-member-search-ico {
  color: var(--text4);
  font-size: .95rem;
  flex: 0 0 auto;
}

.group-member-search-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  min-height: 0;
  background: transparent;
  border: 0;
}

.group-member-search-input:focus {
  outline: none;
  box-shadow: none;
}

.journal-shell {
  animation: fadeUp .3s ease;
}

.journal-shell-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.journal-shell-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.journal-shell-subtitle {
  font-size: .78rem;
  color: var(--text4);
  margin-top: 3px;
}

.journal-shell-notices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.journal-notice {
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.journal-notice.danger {
  background: rgba(232, 98, 74, .08);
  border: 1px solid rgba(232, 98, 74, .2);
}

.journal-notice.success {
  background: rgba(62, 207, 178, .08);
  border: 1px solid rgba(62, 207, 178, .2);
}

.journal-notice.warn,
.journal-notice.info {
  background: rgba(240, 192, 96, .06);
  border: 1px solid rgba(240, 192, 96, .18);
}

.journal-notice.warn {
  cursor: pointer;
  background: rgba(240, 192, 96, .08);
  border-color: rgba(240, 192, 96, .22);
}

.journal-notice-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.journal-notice-title {
  font-size: .87rem;
  font-weight: 700;
}

.journal-notice.danger .journal-notice-title {
  color: var(--coral);
}

.journal-notice.success .journal-notice-title {
  color: var(--teal);
}

.journal-notice.warn .journal-notice-title,
.journal-notice.info .journal-notice-title {
  color: var(--gold);
}

.journal-notice-text {
  font-size: .75rem;
  color: var(--text4);
  line-height: 1.6;
}

.journal-empty-title {
  font-size: 1.1rem;
  color: var(--text3);
  margin-bottom: 8px;
}

.journal-empty-copy {
  font-size: .87rem;
  color: var(--text4);
  margin-bottom: 20px;
}

.journal-story-card {
  margin-bottom: 12px;
}

.journal-story-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.journal-story-emoji {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.journal-story-copy {
  flex: 1;
  min-width: 0;
}

.journal-story-title {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-story-meta {
  font-size: .75rem;
  color: var(--text4);
  margin-top: 2px;
}

.journal-story-log-btn {
  background: var(--tealg);
  border: 1px solid rgba(62, 207, 178, .2);
  color: var(--teal);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  flex-shrink: 0;
}

.journal-story-sessions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-top: 1px solid var(--border3);
  padding-top: 10px;
}

.journal-session-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(220, 232, 245, .03);
  border-radius: 8px;
}

.journal-session-chapter {
  font-size: .72rem;
  color: var(--teal);
  font-weight: 700;
  white-space: nowrap;
  margin-top: 2px;
  min-width: 50px;
}

.journal-session-copy {
  flex: 1;
  min-width: 0;
}

.journal-session-note {
  font-size: .83rem;
  color: var(--text2);
  line-height: 1.5;
  margin: 0 0 2px;
}

.journal-session-time {
  font-size: .7rem;
  color: var(--text4);
}

.journal-session-rating {
  font-size: .85rem;
  flex-shrink: 0;
}

.journal-story-more {
  background: none;
  border: none;
  color: var(--text4);
  font-size: .78rem;
  cursor: pointer;
  text-align: left;
  padding: 6px 0 0;
}

.dna-shell {
  animation: fadeUp .3s ease;
}

.dna-shell-head {
  margin-bottom: 12px;
}

.dna-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 18px;
}

.dna-tutorial-panel {
  padding: 24px 22px;
}

.dna-tutorial-emoji {
  font-size: 2rem;
  margin-bottom: 10px;
}

.dna-tutorial-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.dna-tutorial-copy {
  font-size: .84rem;
  color: var(--text3);
  line-height: 1.7;
  margin-bottom: 16px;
}

.dna-tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.dna-tutorial-step {
  padding: 11px 13px;
  background: rgba(220, 232, 245, .04);
  border: 1px solid var(--border2);
  border-radius: 12px;
}

.dna-step-index {
  color: var(--teal);
}

.dna-tutorial-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dna-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dna-progress-label {
  font-size: .72rem;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.dna-progress-value {
  font-size: .78rem;
  color: var(--teal);
  font-weight: 700;
}

.dna-progress-track {
  background: rgba(220, 232, 245, .07);
  border-radius: 20px;
  height: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}

.dna-progress-bar {
  background: var(--teal);
  height: 100%;
  border-radius: 20px;
  width: 0;
  transition: width .4s ease;
}

.dna-progress-meta {
  font-size: .71rem;
  color: var(--text4);
  text-align: right;
  margin-bottom: 20px;
}

.dna-question-index,
.dna-block-label,
.dna-answers-title {
  font-size: .71rem;
  color: var(--teal);
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.dna-question-text {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 24px;
}

.dna-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dna-option {
  text-align: left;
  padding: 13px 17px;
  background: rgba(220, 232, 245, .04);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  color: var(--text2);
  font-size: .9rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dna-option:hover,
.dna-option.active {
  border-color: var(--teal);
  background: var(--tealg);
  color: var(--text);
}

.dna-option-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(62, 207, 178, .1);
  border: 1px solid rgba(62, 207, 178, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .74rem;
  font-weight: 700;
  color: var(--teal);
  flex-shrink: 0;
}

.dna-answers-panel {
  background: rgba(220, 232, 245, .03);
  border: 1px solid var(--border3);
  border-radius: 12px;
  padding: 12px 16px;
}

.dna-answer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  padding: 3px 0;
}

.dna-answer-check {
  color: var(--teal);
  font-weight: 700;
}

.dna-answer-question {
  color: var(--text3);
  flex: 1;
}

.dna-answer-value {
  color: var(--text);
  font-weight: 600;
  font-size: .76rem;
}

.dna-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.dna-result-subtitle,
.dna-summary-copy,
.dna-summary-note,
.dna-genre-meta,
.dna-share-text {
  font-size: .76rem;
  color: var(--text4);
  line-height: 1.6;
}

.dna-trait-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 48px;
  margin-bottom: 16px;
}

.dna-trait-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  opacity: .8;
}

.dna-traits-list,
.dna-recs-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dna-trait-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  background: rgba(220, 232, 245, .04);
  border-radius: 10px;
  border-left: 3px solid var(--teal);
}

.dna-trait-icon {
  font-size: 1.25rem;
}

.dna-trait-label {
  font-weight: 700;
  font-size: .87rem;
}

.dna-trait-desc {
  font-size: .75rem;
  color: var(--text4);
  margin-top: 1px;
}

.dna-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dna-summary-title {
  font-size: .95rem;
  font-weight: 700;
}

.dna-summary-score {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--teal);
}

.dna-genre-panel {
  background: linear-gradient(135deg, rgba(62, 207, 178, .07), rgba(62, 207, 178, .02));
}

.dna-genre-title,
.dna-recs-title {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.dna-genre-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dna-genre-emoji {
  font-size: 2rem;
}

.dna-genre-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal);
}

.dna-rec-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  background: rgba(220, 232, 245, .03);
  border-radius: 10px;
}

.dna-rec-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.dna-rec-copy {
  flex: 1;
  min-width: 0;
}

.dna-rec-title {
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dna-rec-meta {
  font-size: .73rem;
  color: var(--text4);
  margin-top: 1px;
}

/* start final mobile responsive overrides */
@media (max-width: 768px) {
  #app-nav {
    padding-bottom: 8px;
  }

  #nav-row {
    max-width: none;
    min-height: 58px;
    height: auto;
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  #logo {
    font-size: 1.2rem;
  }

  #nav-right {
    margin-left: auto;
    gap: 6px;
  }

  .nav-post-btn {
    padding: 8px 14px;
    font-size: .82rem;
  }

  .nav-profile-btn {
    padding-right: 10px;
  }

  .nav-profile-name {
    max-width: 58px;
  }

  #srch-wrap {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    margin: 2px 0 0;
  }

  #srch {
    height: 38px;
    font-size: .82rem;
  }

  #tab-row {
    display: none !important;
  }

  #mbar {
    display: flex !important;
  }

  #main {
    max-width: none;
    padding: 14px 12px 88px;
  }

  .sec-head {
    align-items: flex-start;
    gap: 12px;
  }

  .section-head-actions,
  .sec-head > div:last-child {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .section-head-actions .btn,
  .section-head-actions .feed-control-select,
  .sec-head select,
  .sec-head .btn,
  .sec-head .btn-primary {
    width: 100%;
    max-width: none;
  }

  .groups-shell,
  .discover-shell {
    max-width: none;
  }

  .groups-grid,
  .discover-mood-grid,
  .grid2 {
    grid-template-columns: 1fr;
  }

  .card-head,
  .card-body,
  .card-foot,
  .mbody,
  .litem,
  .qcard {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card-head {
    gap: 8px;
    align-items: flex-start;
  }

  .feed-head-actions {
    gap: 6px;
  }

  .card-foot {
    gap: 8px;
  }

  .vote-wrap {
    flex-wrap: wrap;
  }

  .feed-foot-end {
    width: 100%;
    margin-left: 0;
    display: flex;
    justify-content: flex-end;
  }

  .feed-comments-box {
    padding: 12px;
  }

  .feed-comment-composer,
  .feed-comment-editor {
    flex-direction: column;
  }

  .feed-comment-buttons {
    width: 100%;
    flex-direction: row;
  }

  .feed-comment-buttons .btn {
    flex: 1;
  }

  .group-card-actions {
    flex-direction: column;
  }

  .group-card-request {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  #main {
    padding: 12px 10px 86px;
  }

  #logo {
    font-size: 1.08rem;
  }

  .sec-title {
    font-size: 1.08rem;
  }

  .act,
  .vote-pill {
    font-size: .76rem;
  }
}
/* end final mobile responsive overrides */

.dna-rec-link {
  flex-shrink: 0;
  background: var(--tealg);
  border: 1px solid rgba(62, 207, 178, .2);
  color: var(--teal);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .74rem;
  font-weight: 700;
  text-decoration: none;
}

.dna-share-box {
  background: rgba(62, 207, 178, .05);
  border: 1px solid rgba(62, 207, 178, .15);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.dna-share-icon {
  font-size: 1.2rem;
}

.dna-share-title {
  font-size: .83rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .group-detail-hero,
  .group-summary-card,
  .member-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .group-detail-roster-row {
    flex-direction: column;
    gap: 4px;
  }

  .group-detail-roster-value {
    text-align: left;
  }

  .group-detail-roster-head {
    align-items: stretch;
  }

  .group-role-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .group-role-label-wrap {
    padding-top: 0;
  }

  .group-members-view-all-btn {
    flex: 1 1 auto;
  }
}
/* end modal template cleanup */

/* start final feed-story-report polish */
.feed-card-template {
  overflow: hidden;
}

.feed-card-template .card-body {
  padding-bottom: 12px;
}

.feed-body-wrap .feed-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 14px;
}

.feed-card-template .card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 0;
  border-top: 1px solid var(--border3);
}

.feed-card-votes {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.feed-comments-toggle,
.feed-save-toggle,
.feed-report-toggle {
  min-height: 40px;
  border-radius: 999px;
  padding-inline: 14px;
  font-weight: 600;
}

.feed-foot-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-quick-comments {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
}

.feed-comments-box {
  padding: 16px;
}

.feed-comment-composer {
  gap: 14px;
  margin-bottom: 16px;
}

.feed-comment-editor {
  flex: 1;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.feed-comment-input {
  min-height: 88px;
  border-radius: 14px;
  line-height: 1.6;
}

.feed-comment-buttons {
  min-width: 106px;
}

.feed-comments-list {
  gap: 12px;
}

.feed-comment-item {
  padding: 12px;
  border: 1px solid var(--border3);
  border-radius: 14px;
  background: rgba(15, 22, 33, .86);
}

.feed-comment-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.spoiler-wrap {
  margin-bottom: 16px;
  border-radius: 18px;
  overflow: hidden;
}

.spoiler-overlay {
  gap: 12px;
  text-align: center;
}

.spoiler-badge {
  min-width: 96px;
  text-align: center;
}

.story-shell {
  gap: 20px;
}

.story-top {
  gap: 18px;
  align-items: flex-start;
}

.story-top-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.story-meta {
  margin-top: 0;
}

.story-author-row {
  margin-top: 2px;
  padding-top: 4px;
}

.story-author-link {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  color: var(--text);
}

.story-author-link:hover {
  color: var(--teal);
}

.story-author-platform {
  margin-top: 3px;
}

.story-section {
  padding: 18px;
}

.story-body {
  font-size: .96rem;
  line-height: 1.78;
}

.story-actions {
  gap: 14px;
  align-items: center;
}

.story-actions-buttons {
  flex: 1;
  gap: 10px;
}

.story-comment-count {
  margin-left: 0;
  flex-shrink: 0;
}

.story-comments {
  padding: 18px;
}

.story-comment-compose {
  padding: 16px;
  gap: 14px;
  margin-bottom: 16px;
}

.story-comment-input {
  min-height: 106px;
  border-radius: 14px;
}

.story-comment-compose-actions {
  margin-top: 12px;
}

.story-comment {
  padding: 14px;
}

.story-comment-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-reasons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-reason {
  grid-template-columns: 18px 22px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
}

.report-reason-icon {
  width: 22px;
  text-align: center;
}

.report-reason-label {
  font-size: 1rem;
  line-height: 1.35;
}

.modal-submit-btn {
  min-height: 50px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .feed-card-template .card-foot,
  .story-actions,
  .story-comment-compose-actions {
    align-items: stretch;
  }

  .feed-foot-end,
  .story-comment-count {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
    text-align: right;
  }

  .feed-comment-editor,
  .story-top,
  .story-author-row,
  .story-comment-compose {
    flex-direction: column;
  }

  .feed-comment-buttons {
    min-width: 0;
    width: 100%;
    flex-direction: row;
  }

  .feed-comment-buttons .btn,
  .story-comment-compose-actions .btn {
    flex: 1;
  }
}
/* end final feed-story-report polish */

/* start story detail final polish */
.story-shell {
  gap: 22px;
}

.story-top {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 4px;
}

.story-emoji {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 1.85rem;
  box-shadow: inset 0 0 0 1px rgba(62, 207, 178, .06);
}

.story-top-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.story-title {
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 0;
}

.story-meta {
  margin-top: 0;
  row-gap: 10px;
}

.story-author-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 4px;
  padding-top: 0;
}

.story-author-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 1px;
}

.story-author-link {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  color: var(--text);
  text-align: left;
}

.story-author-link:hover,
.story-author-link:focus-visible {
  color: var(--teal);
  text-decoration: none;
  outline: none;
}

.story-author-platform {
  margin-top: 4px;
  line-height: 1.25;
}

.story-section {
  padding: 18px;
  border-radius: 18px;
  background: rgba(220, 232, 245, .035);
}

.story-body {
  font-size: .97rem;
  line-height: 1.82;
}

.story-gallery {
  gap: 12px;
  margin-top: 18px;
}

.story-gallery-item {
  min-height: 150px;
  border-radius: 16px;
}

.story-tags {
  gap: 8px;
  margin-top: 18px;
}

.story-cta-link {
  margin-top: 18px;
  min-height: 46px;
  border-radius: 14px;
  font-weight: 700;
}

.story-actions {
  gap: 14px;
  align-items: center;
  padding: 16px 2px 0;
  flex-wrap: wrap;
}

.story-votes {
  gap: 10px;
}

.story-actions-buttons {
  flex: 1 1 auto;
  gap: 10px;
  flex-wrap: wrap;
}

.story-actions-buttons .act {
  min-height: 40px;
  border-radius: 999px;
  padding-inline: 14px;
  font-weight: 600;
}

.story-comment-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: .8rem;
  align-self: center;
}

.story-comments {
  padding: 18px;
  border-radius: 18px;
}

.story-comments-head {
  margin-bottom: 16px;
}

.story-comment-compose {
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
}

.story-current-avatar {
  flex-shrink: 0;
}

.story-comment-input {
  min-height: 112px;
  padding: 14px 15px;
  line-height: 1.6;
}

.story-comment-compose-actions {
  margin-top: 12px;
}

.story-comment-submit {
  min-width: 154px;
}

.story-comment-list {
  gap: 14px;
}

.story-comment {
  gap: 12px;
  padding: 15px;
  border-radius: 16px;
}

.story-comment-avatar {
  flex-shrink: 0;
}

.story-comment-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-comment-head {
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.story-comment-user {
  appearance: none;
  -webkit-appearance: none;
  font-weight: 700;
  text-decoration: none;
}

.story-comment-body {
  font-size: .9rem;
  line-height: 1.65;
}

.story-comment-actions {
  gap: 10px;
  margin-top: 2px;
}

.story-comment-actions .vote-wrap {
  gap: 8px;
}

.story-empty {
  padding: 16px 14px;
  border-radius: 14px;
}

.report-modal-stack {
  gap: 16px;
}

.report-reasons-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-reason {
  display: grid;
  grid-template-columns: 18px 24px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-radius: 16px;
  padding: 16px;
}

.report-reason-mark {
  justify-self: center;
}

.report-reason-icon {
  width: 24px;
  text-align: center;
  justify-self: center;
}

.report-reason-label {
  display: block;
  line-height: 1.32;
}

.modal-copy {
  margin-bottom: 2px;
}

@media (max-width: 720px) {
  .story-top {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
  }

  .story-title {
    font-size: 1.3rem;
  }

  .story-author-row {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
  }

  .story-actions-buttons {
    width: 100%;
    flex: 1 0 100%;
  }

  .story-comment-count {
    width: 100%;
    text-align: right;
  }

  .story-comment-compose-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .story-comment-submit {
    width: 100%;
    min-width: 0;
  }
}
/* end story detail final polish */
