:root {
  --bg: var(--bg-base);
  --paper: var(--bg-surface);
  --ink: var(--text-primary);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-subtle);
  --green: var(--gold-solid);
  --deep: var(--bg-base);
  --mint: var(--bg-elevated);
  --coral: var(--gold-solid);
  --forest: var(--bg-base);
  --on-forest: var(--text-primary);
  --forest-muted: var(--text-secondary);
  --radius: 16px;
  --display: Georgia, 'Times New Roman', serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

body { font-variant-numeric: tabular-nums; }
:is(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
:where(button, a, input, textarea, select) { accent-color: var(--green); }
.icon { width: 18px; height: 18px; stroke-width: 1.5; }
.brand-mark { border-radius: 9px; }
.brand-name { font-size: 24px; font-weight: 650; letter-spacing: -.045em; }

.button {
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.button.primary { background: var(--green); color: var(--text-primary); }
.button.primary:hover { background: var(--deep); }
.button.outline { border-color: var(--line); color: var(--ink); background: var(--paper); }
.button.outline:hover { border-color: var(--green); background: var(--mint); }
.button:active { transform: translateY(1px); }

.field label { color: var(--ink); font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea, .locale-select, .community-toolbar .locale-select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
.locale-select, .community-toolbar .locale-select {
  max-width: none;
  padding-inline: 12px 8px;
  font-size: 13px;
}
.feature-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.auth-story h1, .demo-feature.hero h1, .community-hero h1 {
  font: 400 clamp(40px, 4.4vw, 68px)/1.02 var(--display);
  letter-spacing: -.055em;
  text-wrap: balance;
}
html:is([lang="zh-CN"], [lang="ja"]) :is(.auth-story, .demo-feature.hero, .community-hero) h1 {
  font-family: var(--heading);
  line-height: 1.16;
  letter-spacing: -.025em;
}

/* A product preview uses two sample portraits and the call's control layout. */
.call-preview {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--forest);
  color: var(--on-forest);
}
.call-preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 12px;
  color: var(--forest-muted);
  font-size: 12px;
}
.call-preview-label .icon { width: 16px; height: 16px; }
.call-preview-frames {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr);
  gap: 8px;
  aspect-ratio: 1.94;
}
.call-preview-frame {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-radius: 8px;
  background: var(--bg-elevated);
}
.call-preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 53%;
}
.call-preview-frame:last-child img { object-position: center 31%; }
.call-preview-frame > span {
  position: absolute;
  inset: auto auto 12px 12px;
  max-width: calc(100% - 24px);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12px;
}
.call-preview-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 4px;
}
.call-preview-controls > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-elevated);
}
.call-preview-controls .icon { width: 16px; height: 16px; }
.call-preview-controls > .call-preview-end { background: var(--coral); color: var(--text-primary); }

/* The sign-in form remains near the top of the reading order on narrow screens. */
.auth-header, .auth-layout {
  width: min(calc(100% - 96px), 1200px);
  max-width: none;
  margin-inline: auto;
}
.auth-header { margin-block: 24px; padding: 0; }
.auth-header .brand-name { display: block; }
.auth-language { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  min-height: min(688px, calc(100svh - 156px));
  padding: 24px 0;
  border: 0;
  border-radius: 0;
  background: none;
  overflow: visible;
}
.auth-story {
  display: grid;
  align-content: center;
  gap: 28px;
  min-height: 0;
  padding: 0;
  background: none;
  color: var(--ink);
}
.auth-story h1 { max-width: 12ch; margin: 0; font-size: clamp(48px, 5.4vw, 80px); }
.auth-story p {
  max-width: 37ch;
  margin-top: 16px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.55;
}
.auth-form-wrap {
  width: 100%;
  align-self: center;
  padding: clamp(24px, 3vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.auth-form-wrap h2 { color: var(--ink); font-size: 27px; font-weight: 600; letter-spacing: -.04em; }
.auth-form-wrap > p { margin: 8px 0 16px; color: var(--muted); font-size: 14px; }
.auth-tabs { gap: 20px; margin-bottom: 20px; }
.auth-tabs button { min-height: 44px; padding: 0 0 4px; color: var(--muted); font-size: 14px; }
.auth-tabs button.active { font-weight: 600; }
.auth-form .field { gap: 8px; margin-bottom: 16px; }
.auth-form .check-field, .auth-password-hint { font-size: 13px; color: var(--muted); }
.auth-demo-link {
  min-height: 44px;
  margin-top: 4px;
  color: var(--green);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-footer { margin-block: 20px 24px; color: var(--muted); font-size: 12px; }
@media (prefers-reduced-motion: no-preference) {
  #community-app:has(.auth-hero[data-enter]) { animation: starmeet-enter .38s var(--ease) both; }
  #app .hero-row { animation: starmeet-enter .38s var(--ease) both; }
}
@keyframes starmeet-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Signed-in and demo workspaces share navigation, controls and portrait cards. */
.shell { grid-template-columns: 216px minmax(0, 1fr); }
.sidebar {
  padding: 24px 16px 20px;
  background: var(--paper);
  overflow-y: auto;
}
.sidebar .brand { margin: 0 0 32px 4px; }
.sidebar .nav { gap: 4px; margin: 0; }
.sidebar .nav-item, .sidebar .utility-link {
  min-height: 44px;
  padding: 8px 12px;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.sidebar .nav-item.active, .sidebar :is(.utility-link, .nav-item):hover {
  color: var(--green);
  background: var(--mint);
}
.sidebar-bottom { padding-top: 16px; }
.side-profile { margin-top: 12px; padding-top: 12px; }
.side-profile > div { min-width: 0; }
.side-profile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-profile small { color: var(--muted); }
.nav-count { background: var(--green); }
.workspace { max-width: 1504px; padding: 24px clamp(20px, 3.3vw, 48px) 32px; }
.topbar { margin-bottom: 20px; gap: 12px; }
.top-title { font-size: 24px; font-weight: 600; letter-spacing: -.035em; }
.top-actions, .community-toolbar { gap: 8px; }
.community-toolbar { margin-left: auto; }
.search-box, .icon-button { min-height: 44px; }
.search-box input { font-size: 14px; }
.search-box input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.icon-button { width: 44px; border-radius: 8px; color: var(--green); }
.page-footer, .footer-links button { color: var(--muted); font-size: 12px; }

.hero-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.demo-feature.hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  min-height: 0;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
html[lang] .demo-feature .hero-copy { width: auto; max-width: none; }
.demo-feature.hero h1 { margin: 12px 0; text-wrap: wrap; }
.demo-feature.hero p, .community-hero p {
  max-width: 39ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
html[lang] .demo-feature .hero-cta { flex-wrap: wrap; width: auto; gap: 8px; margin: 20px 0 0; }
html[lang] .demo-feature .hero-cta .button { margin: 0; padding: 8px 12px; font-size: 14px; }
.demo-feature .hero-cta .secondary {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--green);
}
.demo-feature .hero-cta .secondary:hover { background: var(--mint); border-color: var(--green); }
.daily-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 24px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mint);
}
.daily-top {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.daily-card p {
  max-width: none;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-style: normal;
  line-height: 1.4;
}
.shuffle-button {
  min-height: 44px;
  margin: 0;
  color: var(--green);
  font-size: 13px;
}
.shuffle-button:hover, .section-heading .text-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.community-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
  gap: 24px;
  align-items: center;
  min-height: 0;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.saved-feature { grid-template-columns: minmax(0, 1fr); }
.community-hero h1 { margin: 0 0 12px; font-size: clamp(32px, 4vw, 56px); text-wrap: wrap; }
.feature-action { margin-top: 16px; }
.hero-cta .feature-action { margin: 0; }
.feature-privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.feature-privacy .icon { flex: none; width: 16px; height: 16px; }
.match-options { display: grid; gap: 8px; }
.match-options > span {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green);
  font-weight: 500;
}
.community-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
}
.discovery-heading, .interest-section, .people-section { margin-top: 24px; }
.discovery-heading { margin-bottom: 12px; }
.discovery-heading h2, .section-heading h2 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
}
.section-heading { min-height: 44px; margin-bottom: 12px; }
.section-heading .text-button { min-height: 44px; color: var(--green); font-size: 13px; }
.listing-title { flex-wrap: wrap; gap: 4px 12px; }
.listing-title small { padding: 0; background: none; color: var(--muted); font-size: 12px; }
.listing-tools { gap: 8px; }
.filter-button, .sort-select { min-height: 44px; color: var(--text); font-size: 13px; }
.live-filters { gap: 8px; margin-bottom: 16px; }
.live-filters .search-box, .live-filters select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
  font-size: 14px;
}
.live-filters .search-box { width: min(44%, 360px); }
.live-filters .search-box input::placeholder { color: var(--muted); }
.interests { gap: 8px; }
.interest-chip {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  background: var(--paper);
  font-size: 13px;
}
.interest-chip.active { color: var(--green); background: var(--mint); border-color: var(--border-subtle); }
.interest-chip:hover { border-color: var(--green); }

.people-grid { gap: 16px; }
.person-card {
  display: flex;
  flex-direction: column;
  border-color: var(--line);
  border-radius: 12px;
  background: var(--paper);
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.person-card:hover { transform: translateY(-2px); border-color: var(--border-subtle); box-shadow: none; }
.person-card:hover .person-photo img { transform: scale(1.025); }
.person-photo { height: auto; aspect-ratio: 1.22; }
.community .person-photo { height: auto; aspect-ratio: 1.5; background: var(--mint); }
.photo-gradient { display: none; }
.photo-open:focus-visible { outline-offset: -4px; }
.community .real-person-avatar strong { color: var(--green); background: var(--paper); backdrop-filter: none; }
.save-button {
  width: 44px;
  height: 44px;
  background: var(--paper);
  color: var(--green);
  backdrop-filter: none;
}
.save-button .icon { width: 18px; height: 18px; }
.save-button.saved { color: var(--green); }
.save-button.saved .icon { fill: var(--green); stroke: var(--green); }
.person-info { display: flex; flex: 1; flex-direction: column; padding: 12px; }
.person-name { color: var(--ink); font-size: 17px; font-weight: 600; letter-spacing: 0; }
.person-name span, .person-location, .real-card-bio { color: var(--muted); font-size: 13px; }
.person-location { display: block; white-space: normal; }
.community .person-location .icon { margin-right: 4px; }
.person-tags { flex-wrap: wrap; margin-block: 12px; }
.person-tag, .community .person-tag { background: var(--mint); color: var(--text); font-size: 12px; }
.card-connect, .real-card-actions .card-connect, .real-card-actions .icon-button {
  min-height: 44px;
  background: var(--mint);
  color: var(--green);
  font-size: 13px;
}
.person-info > .card-connect, .person-info > .real-card-actions { margin-top: auto; }
.card-connect:hover, .real-card-actions .icon-button:hover { background: var(--bg-elevated); }
.empty-state { padding: 40px 20px; color: var(--muted); background: var(--paper); }
.empty-state h3 { font-weight: 600; }
.empty-state p { font-size: 14px; }

/* Secondary screens use the same controls and text roles. */
.page-intro h1 { color: var(--ink); font-weight: 600; }
.page-intro p, .contact-note, .history-status, .service-empty, .service-record p,
.conversation-copy p, .chat-heading small, .chat-disclaimer, .live-chat-placeholder {
  color: var(--muted);
  font-size: 13px;
}
.live-messages, .history-row, .profile-form, .service-panel, .service-card {
  border-color: var(--line);
  background: var(--paper);
}
.live-messages, .service-panel { border-radius: var(--radius); }
.chat-messages { background: var(--bg); }
.bubble { background: var(--mint); color: var(--text); font-size: 14px; }
.bubble.self { background: var(--green); color: var(--text-primary); }
.bubble small { font-size: 12px; opacity: .9; }
.call-stage, .call-actions, .call-actions-waiting { background: var(--forest); }
.call-stage > p { color: var(--forest-muted); font-size: 13px; }
.call-actions button, .call-actions-waiting button { min-height: 44px; }
.match-modal, .service-modal, .modal-sheet { border-radius: var(--radius); }
.service-panel .page-intro .eyebrow { color: var(--muted); font-size: 13px; letter-spacing: 0; }
.service-card { border-radius: 12px; }
.service-record { border-color: var(--line); }
.service-links { gap: 4px; }
.service-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
}
.service-links a:hover, .service-links a[aria-current="page"] {
  color: var(--green);
  background: var(--mint);
  text-decoration: none;
}

@media (max-width: 1020px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-inline: 8px; }
  .sidebar .brand { margin-left: 0; }
  .sidebar .nav-item, .sidebar .utility-link { justify-content: center; }
  .sidebar .utility-link[href="/admin.html"] { font-size: 12px; padding-inline: 0; }
  .demo-feature.hero { gap: 20px; }
}
@media (max-width: 820px) {
  .auth-header, .auth-layout { width: min(calc(100% - 40px), 640px); }
  .auth-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 24px; padding-block: 12px; }
  .auth-story { display: contents; }
  .auth-story-copy { grid-row: 1; }
  .auth-story h1 { max-width: none; font-size: clamp(40px, 7.5vw, 58px); }
  .auth-form-wrap { grid-row: 2; }
  .auth-story .call-preview { grid-row: 3; }
  .daily-card { grid-template-columns: minmax(0, 1fr) auto; }
  .daily-card p { grid-row: 2; }
  .daily-card .shuffle-button { grid-row: 1 / 3; grid-column: 2; align-self: center; }
  .community .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .shell { display: block; }
  .auth-header { margin-block: 16px; }
  .auth-language { gap: 4px; }
  .auth-story p { margin-top: 8px; font-size: 15px; }
  .auth-form-wrap { padding: 20px; }
  .auth-form-wrap h2 { font-size: 23px; }
  .workspace { padding: 16px 16px calc(80px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 16px; }
  .community .topbar { flex-wrap: wrap; gap: 8px; }
  #app .topbar { position: relative; flex-wrap: wrap; }
  #app .top-actions { margin-left: 0; flex-basis: 100%; }
  #app .top-actions .search-box, #app .mobile-search-trigger { width: 44px; height: 44px; }
  #app .top-actions .search-box:focus-within { inset: 100% 0 auto; width: auto; }
  .mobile-nav {
    background: var(--paper);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    backdrop-filter: none;
  }
  .mobile-nav button { justify-content: center; min-height: 48px; color: var(--muted); font-size: 12px; line-height: 1.15; }
  .mobile-nav button.active::before { top: -5px; }
  .demo-feature.hero { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .demo-feature.hero h1 { font-size: clamp(38px, 9vw, 52px); }
  .demo-feature.hero p, .community-hero p { font-size: 15px; }
  .demo-feature.hero .hero-cta .button { flex: 1 1 auto; }
  .daily-card { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .daily-card p, .daily-card .shuffle-button { grid-column: 1; grid-row: auto; justify-self: start; }
  .shuffle-button { padding-inline: 0; }
  .community-hero { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .match-options { display: none; }
  .live-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-filters .search-box { grid-column: 1 / -1; width: 100%; }
  .live-filters select { width: 100%; max-width: none; }
  .live-filters .search-box input, .live-filters select, .search-box input { font-size: 16px; }
  .interests, .community .interests { margin-right: 0; padding-right: 0; }
  .people-grid { gap: 8px; }
  .person-info { padding: 8px; }
  .auth-language .locale-select { padding-inline: 8px 4px; }
  .person-name { font-size: 15px; }
  .person-tag, .community .person-tag { font-size: 12px; }
  .real-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .real-card-actions .card-connect { grid-column: 1 / -1; }
  .real-card-actions .icon-button { width: 100%; }
  .save-button { top: 8px; right: 8px; }
}
