body {
  min-height: 100vh;
  background: radial-gradient(circle at top right, #fde1ec 0%, var(--cream) 42%, var(--sand) 100%);
}

.demo-bar {
  background: var(--ink);
  color: var(--on-ink);
  border-bottom: 2px solid var(--pink);
  padding: 8px 14px;
}

.demo-bar__inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.demo-bar__left,
.demo-bar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-bar__label {
  font-size: 12.5px;
  color: var(--on-ink-muted);
  font-weight: 700;
}

.demo-bar__select {
  width: auto;
  min-width: 220px;
  padding: 6px 10px;
  font-size: 13px;
}

.shell {
  width: 100%;
  max-width: 440px;
  min-height: calc(100vh - 54px);
  margin: 12px auto 20px;
  background: var(--cream);
  border: var(--bw) solid var(--ink);
  border-radius: 26px;
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  position: relative;
}

.shell.is-wide {
  max-width: 920px;
}

.shell.is-wide .bottom-nav,
.shell.is-wide .floating-composer {
  max-width: 920px;
}

@media (max-width: 520px) {
  .shell {
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .bottom-nav,
  .floating-composer {
    left: 0;
    transform: none;
    max-width: 100%;
    border-left: 0;
    border-right: 0;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--paper);
  border-bottom: var(--bw) solid var(--ink);
}

.topbar__brand {
  display: grid;
  gap: 2px;
}

.brand-logo {
  font: 900 18px/1 var(--f-display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.brand-logo span {
  color: var(--pink);
}

.brand-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font: 800 12px/1 var(--f-display);
  text-transform: uppercase;
}

.icon-pill__q {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  display: grid;
  place-items: center;
  font-size: 12px;
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: var(--bw) solid var(--ink);
  background: var(--pink);
  color: var(--ink);
  font: 900 13px/1 var(--f-display);
  display: grid;
  place-items: center;
  box-shadow: 2px 2px 0 var(--ink);
}

.ribbon {
  background: var(--yellow);
  border-bottom: var(--bw) solid var(--ink);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.main {
  flex: 1;
  padding: 14px 14px calc(92px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 14px;
  align-content: start;
}

.tab-pane {
  display: grid;
  gap: 14px;
}

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

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Hook of the day */
.hook-hero {
  display: grid;
  gap: 12px;
}

.hook-hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hook-quote {
  margin: 0;
  padding: 12px 14px;
  border-left: 5px solid var(--pink);
  background: var(--pink-soft);
  border-radius: 0 12px 12px 0;
  font-weight: 800;
  font-size: 15.5px;
  line-height: 1.45;
}

.format-box {
  background: var(--sand);
  border: var(--bw) solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.4;
}

.format-box__label {
  display: block;
  font: 800 11px/1.2 var(--f-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pink-ink);
  margin-bottom: 3px;
}

/* Checkin */
.checkin-card {
  display: grid;
  gap: 12px;
}

.checkin-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.streak-badge {
  min-width: 82px;
  padding: 8px 10px;
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  background: var(--yellow);
  text-align: center;
  box-shadow: 2px 2px 0 var(--ink);
}

.streak-badge strong {
  display: block;
  font: 900 22px/1 var(--f-display);
}

.streak-badge span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.checkin-form {
  display: grid;
  gap: 10px;
}

.checkin-extra {
  background: var(--sand);
  border: var(--bw) solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
}

.checkin-extra summary {
  font: 800 12.5px/1.2 var(--f-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pink-ink);
  cursor: pointer;
  list-style: none;
}

.checkin-extra summary::-webkit-details-marker {
  display: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--pink);
}

.live-card {
  display: grid;
  gap: 10px;
}

.live-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Passport & AI */
.passport-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.passport-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.quota-bar {
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.quota-bar__text {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
}

.quota-track {
  height: 10px;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  overflow: hidden;
}

.quota-track i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--pink);
  transition: width 0.25s ease;
}

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

.skill-card {
  text-align: left;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 6px;
  align-content: space-between;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease, background 0.1s ease;
}

.skill-card:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.skill-card.is-active {
  background: var(--pink-soft);
  border-color: var(--pink-ink);
}

.skill-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: wrap;
}

.skill-card__cat {
  font: 800 10.5px/1 var(--f-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink-ink);
}

.skill-card__badge {
  font: 900 9.5px/1 var(--f-display);
  padding: 3px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--yellow);
  text-transform: uppercase;
}

.skill-card__title {
  font: 900 14px/1.2 var(--f-display);
  text-transform: uppercase;
}

.skill-card__desc {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-card__cta {
  font: 800 11.5px/1 var(--f-display);
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 4px;
}

.ai-dialog-view {
  display: grid;
  gap: 12px;
}

.ai-dialog-head {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.ai-dialog-head__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-dialog-head__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.back-btn {
  background: var(--yellow);
}

.clear-armed {
  background: var(--orange) !important;
  color: #fff !important;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  padding: 6px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--sand);
  font-size: 12px;
  font-weight: 700;
}

.chip-btn:hover {
  background: var(--yellow);
}

.ai-messages {
  display: grid;
  gap: 10px;
}

.ai-messages--full {
  padding-bottom: 145px;
}

.ai-bubble--typing {
  background: var(--sand) !important;
  color: var(--muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.typing-dots::after {
  content: "...";
  animation: pulseDots 1.2s infinite;
}

@keyframes pulseDots {
  0%, 20% { opacity: 0.25; }
  50% { opacity: 1; }
  100% { opacity: 0.25; }
}

.ai-bubble {
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.md-h {
  font: 800 14.5px/1.3 var(--f-display);
  margin: 6px 0 4px;
}

.md-sp {
  height: 7px;
}

.md-line {
  margin-bottom: 2px;
}

.md-table-wrap {
  overflow-x: auto;
  margin: 8px 0;
  border: var(--bw) solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.35;
}

.md-table th, .md-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.md-table th {
  background: var(--yellow);
  font: 800 11.5px/1.2 var(--f-display);
  text-transform: uppercase;
}

.md-table tr:last-child td {
  border-bottom: 0;
}

.md-table th:last-child, .md-table td:last-child {
  border-right: 0;
}

.ai-bubble--user {
  background: var(--yellow);
  margin-left: 24px;
}

.ai-bubble--assistant {
  background: #fff;
  margin-right: 10px;
}

.ai-bubble__foot {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.ai-input-row {
  display: grid;
  gap: 8px;
}

.ai-textarea {
  min-height: 54px;
  max-height: 112px;
}

.floating-composer {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  z-index: 28;
  background: var(--paper);
  border-top: var(--bw) solid var(--ink);
  border-left: var(--bw) solid var(--ink);
  border-right: var(--bw) solid var(--ink);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  box-shadow: 0 -4px 12px rgba(22, 18, 15, 0.08);
}

/* Chat without DMs */
.chat-privacy-plate {
  font-size: 12.5px;
}

.rooms-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.room-pill {
  flex: none;
  padding: 8px 12px;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font: 800 12px/1 var(--f-display);
  text-transform: uppercase;
}

.room-pill.is-active {
  background: var(--pink);
  box-shadow: 2px 2px 0 var(--ink);
}

.pinned-box {
  background: var(--pink-soft);
  border-color: var(--pink-ink);
  font-size: 13.5px;
}

.chat-feed {
  display: grid;
  gap: 10px;
}

.chat-feed--full {
  padding-bottom: 92px;
}

.chat-msg {
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.chat-msg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-author-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.chat-ava {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  font: 900 11px/1 var(--f-display);
  flex: none;
}

.chat-author-name {
  font-weight: 800;
  font-size: 13.5px;
}

.chat-author-niche {
  font-size: 11.5px;
  color: var(--muted);
}

.chat-reply-quote {
  border-left: 3px solid var(--ink);
  background: var(--sand);
  padding: 5px 8px;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: var(--muted);
}

.chat-msg__text {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-msg__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.link-btn {
  font-weight: 800;
  color: var(--pink-ink);
  font-size: 12px;
}

.reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--sand);
  border: var(--bw) solid var(--ink);
  border-radius: 10px;
  font-size: 12.5px;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  min-height: 60px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border-top: var(--bw) solid var(--ink);
  border-left: var(--bw) solid var(--ink);
  border-right: var(--bw) solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-btn {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 9px 2px;
  font: 800 10px/1.1 var(--f-display);
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn__ic {
  font-size: 17px;
}

.nav-btn.is-active {
  background: var(--pink-soft);
  color: var(--ink);
  border-top: 3px solid var(--pink);
}

/* Modals & paused */
.paused-card {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.paused-box {
  background: var(--sand);
  border: var(--bw) solid var(--ink);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  display: grid;
  gap: 4px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(22, 18, 15, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
}

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

.modal-close {
  width: 32px;
  height: 32px;
  border: var(--bw) solid var(--ink);
  border-radius: 50%;
  background: var(--sand);
  font-weight: 900;
}

.member-card-body {
  display: grid;
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--ink);
  color: var(--yellow);
  border: 2px solid var(--yellow);
  border-radius: 999px;
  padding: 9px 16px;
  font: 800 13px/1.2 var(--f-display);
  box-shadow: var(--sh);
}
