*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button,
input,
textarea,
select,
a,
label,
[role="button"] {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
input:focus,
input:focus-visible {
  outline: none;
}

img {
  display: block;
  max-width: 100%;
}

.app {
  width: min(430px, 100%);
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  flex: 0 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--separator);
  background: var(--bg);
  text-align: left;
}

.topbar-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.topbar h1 {
  margin: 0;
  padding: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-align: left;
  line-height: 1.1;
  color: var(--text);
}

.me-avatar {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1.5px rgba(255, 149, 0, 0.55);
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}

.me-avatar.hidden {
  visibility: hidden;
  pointer-events: none;
}

.screens {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
}

.screen {
  display: none;
  height: 100%;
  overflow: auto;
  padding: 16px 16px calc(108px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.screen.is-active {
  display: block;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: 28px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.card-photo {
  width: 100%;
  max-height: 46dvh;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--bg-grouped);
}

.card-body {
  padding: 16px 16px 18px;
}

.card-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.card-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.card-age {
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 600;
}

.card-city {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.card-city:empty {
  display: none;
}

.card-bio {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.4;
  min-height: 1.4em;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.btn {
  height: 52px;
  border-radius: 16px;
  border: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn-primary {
  background: var(--button);
  color: var(--button-text);
}

.btn-secondary {
  background: transparent;
  color: var(--button);
  border: 1.5px solid var(--button);
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.35;
}

.bubble-sent {
  align-self: flex-end;
  background: var(--sent);
  color: var(--sent-text);
  border-bottom-right-radius: 5px;
}

.bubble-received {
  align-self: flex-start;
  background: var(--received);
  color: var(--received-text);
  border-bottom-left-radius: 5px;
}

.chat-row,
.mentor-row,
.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--separator);
}

button.chat-row {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--separator);
  color: inherit;
  text-align: left;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--bg-grouped);
  flex: 0 0 auto;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text-muted);
}

.row-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.row-copy h3,
.row-copy p {
  margin: 0;
}

.row-copy h3 {
  font-size: 16px;
  font-weight: 650;
}

.row-copy p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-box {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: var(--bg-grouped);
  color: var(--text);
  outline: none;
}

.empty {
  margin-top: 48px;
  text-align: center;
  color: var(--text-muted);
}

.switch {
  width: 51px;
  height: 31px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-grouped);
  position: relative;
}

.switch.is-on {
  background: var(--button);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 180ms ease;
}

.switch.is-on::after {
  transform: translateX(20px);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--tabbar);
  border-top: 1px solid var(--separator);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  z-index: 20;
}

.card-bio:empty {
  display: none;
}

.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--tab-inactive);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0 0;
}

.tab svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tab.is-active {
  color: var(--tab-active);
}

.tab svg.tab-heart {
  fill: none;
  stroke: none;
}

.tab svg.tab-heart path {
  fill: currentColor;
  stroke: none;
}

.tab.is-active .tab-heart {
  filter: drop-shadow(0 0 5px #ff9500) drop-shadow(0 0 10px rgba(255, 149, 0, 0.45));
}

.tab-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  margin-left: 18px;
  margin-top: 1px;
}

.hidden {
  display: none !important;
}

.back-btn {
  border: 0;
  background: transparent;
  color: var(--button);
  font-weight: 650;
  padding: 0;
  text-align: left;
  flex: 0 0 auto;
}

.topbar .back-btn.hidden {
  display: none !important;
}

.welcome {
  min-height: 72%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 12px 8px 24px;
}

.welcome h2 {
  margin: 8px 0 0;
  font-size: 32px;
  letter-spacing: -0.05em;
}

.welcome-copy {
  margin: 0;
  color: var(--text-muted);
}

.welcome-mark {
  width: min(62vw, 208px);
  margin: 0 0 2px;
}

.welcome-mark img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.btn-block {
  width: 100%;
  max-width: 280px;
}

.swipe-actions,
.swipe-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 16px;
  position: sticky;
  bottom: 12px;
  z-index: 8;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.swipe-btn,
.btn,
.tab {
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.welcome h2[data-action="start-search"] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.swipe-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease, background-color 0.15s ease;
}

.swipe-btn:active {
  transform: scale(0.92);
}

.swipe-btn svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  margin: auto;
  pointer-events: none;
}

.swipe-nope {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1.5px solid var(--separator);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.swipe-nope:hover {
  color: #ff453a;
  border-color: rgba(255, 69, 58, 0.4);
}

.swipe-like {
  background: var(--bg-elevated);
  color: #ff9500;
  border: 1.5px solid rgba(255, 149, 0, 0.6);
  box-shadow: 0 0 24px rgba(255, 149, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.25);
}

.swipe-like:hover {
  border-color: #ff9500;
  box-shadow: 0 0 28px rgba(255, 149, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.25);
}

.swipe-like svg,
.swipe-like .heart-icon {
  width: 34px;
  height: 34px;
  fill: #ff9500;
  stroke: none;
  display: block;
  margin: auto;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 149, 0, 0.9));
}

.hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.tag {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--bg-grouped);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.tag.is-on {
  background: var(--button);
  color: var(--button-text);
}

.section-label {
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.online {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
  flex: 0 0 auto;
}

.online.is-off {
  background: var(--text-muted);
}

.setting-link {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--separator);
}

.chevron {
  color: var(--text-muted);
  font-size: 22px;
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.area {
  height: 96px;
  padding: 12px 14px;
  resize: none;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
}

.segmented button {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--separator);
  background: var(--bg-grouped);
  color: var(--text);
  font-weight: 700;
}

.segmented button.is-on {
  background: var(--button);
  color: var(--button-text);
  border-color: transparent;
}

.search-hit {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--separator);
}

.search-hit img {
  width: 56px;
  height: 70px;
  object-fit: cover;
  border-radius: 12px;
}

.community-lead {
  margin: 4px 0 16px;
  color: var(--text-muted);
  font-size: 15px;
}

.community-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.community-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 149, 0, 0.12);
  color: var(--button);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.community-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 8px 120px;
  gap: 10px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 149, 0, 0.55);
}

.profile-hero h2 {
  margin: 8px 0 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.profile-meta,
.profile-bio {
  margin: 0;
  color: var(--text-muted);
}

.profile-bio:empty {
  display: none;
}

.profile-edit-fab {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  width: min(280px, calc(100% - 48px));
}

select.search-box {
  appearance: none;
  -webkit-appearance: none;
}

.app.thread-open .tabbar {
  display: none;
}

.screen[data-screen="thread"].is-active {
  display: flex;
  flex-direction: column;
  padding: 8px 12px calc(78px + env(safe-area-inset-bottom));
}

.thread-log {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.bubble video,
.bubble img {
  display: block;
  max-width: 220px;
  width: 100%;
  border-radius: 12px;
  background: #000;
}

.composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, 100%);
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--separator);
  z-index: 20;
}

.composer-input {
  flex: 1 1 auto;
  height: 36px;
  border: 0;
  border-radius: 18px;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.composer-attach,
.composer-send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.composer-attach {
  background: var(--bg-elevated);
  color: var(--button);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.composer-send {
  background: #007aff;
  color: #fff;
}

.composer-send svg {
  width: 16px;
  height: 16px;
}

.media-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.media-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  background: var(--bg-grouped);
}

.media-actions {
  width: 100%;
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.media-btn {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
}
