/*
 * JK Typography & Alignment Reset — owner-approved visual layer.
 * Built on PR #126 (auth branch). Presentation only.
 * No navigation, data, gate, consent, analytics, permission or event mutations.
 * A = airy typography; B = existing JK monochrome + Coral identity.
 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap");

:root {
  --jk-type-ui: "Inter", "Noto Sans Thai", "Segoe UI", Tahoma, system-ui, sans-serif;
  --jk-ui-font: var(--jk-type-ui);
  --jk-ui-title: 24px;
  --jk-ui-body: 14px;
  --jk-ui-label: 14px;
  --jk-ui-caption: 12px;
}
#phone,
#phone :is(button, input, select, textarea, summary),
#phone :is(.screen, .reader, .chat-thread, .entry-flow),
#jk-thread-live-dialog,
#jk-thread-dialog,
#jk-story-dialog {
  font-family: var(--jk-type-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#phone { --font-ui: var(--jk-type-ui); }

/* Thai text needs rhythm rather than very heavy weights or negative tracking. */
#phone :is(.screen, .entry-flow, .reader, .chat-thread) {
  letter-spacing: normal;
  overflow-wrap: break-word;
}
#phone :is(.screen, .reader, .chat-thread, .entry-flow) :is(p, small, label, li, time, dd, dt) {
  line-height: 1.6;
  letter-spacing: normal;
}
#phone .screen .jk-main-topbar .h1 {
  font-size: clamp(23px, 6.3vw, 27px);
  font-weight: 600 !important;
  line-height: 1.38;
  letter-spacing: -.018em;
  overflow-wrap: anywhere;
}
#phone.story-context .screen .jk-main-topbar .h1 {
  font-weight: 600 !important;
}
#phone .jk-screen-title { min-width: 0; align-items: center; }
#phone .jk-screen-title > div { min-width: 0; }
#phone .jk-brand-name,
#phone #entry-flow .entry-brand .jk-brand-name {
  font-weight: 600 !important;
  letter-spacing: -.018em;
  line-height: 1.35;
}
#phone .screen :is(.section-head h3, .jk-ia-people-heading h3, .home-live h2, .jk-ia-meet-intro h2, .thread-section-heading, .thread-card h3, .deep-section-head h3, .jk-live-head h2) {
  font-weight: 600 !important;
  line-height: 1.48;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}
#phone .screen :is(.mpr-person .name, .person-name, .profile-name, .jk-self-profile b, .thread-card b, .story-title, .jk-profile-hero b) {
  font-weight: 600 !important;
  line-height: 1.5;
  letter-spacing: normal;
}
#phone .screen :is(.mpr-person .person-reason, .person-reason, .thread-card p, .thread-note, .story-excerpt, .bio, .jk-profile-intro) {
  font-weight: 400 !important;
  line-height: 1.7;
  letter-spacing: normal;
}
#phone .screen :is(.sub, .meta, .mpr-area, .jk-ia-screen-tag, .jk-ia-kicker, .person-reason-note, .thread-type, .thread-activity, .home-live p, .ux-note) {
  font-weight: 400 !important;
  line-height: 1.55;
  letter-spacing: normal;
}
#phone :is(.screen, .reader, .entry-flow, .chat-thread) button:not(.navbtn) {
  line-height: 1.45;
  letter-spacing: normal;
  font-weight: 500;
}
#phone :is(.screen, .reader, .entry-flow) button:has(> b),
#phone :is(.screen, .reader, .entry-flow) button:has(> strong) {
  line-height: 1.5;
}
#phone :is(.screen, .reader, .entry-flow) :is(button, a).btn,
#phone .screen .mpr-person .btn,
#phone .screen .thread-chip,
#phone .screen .jk-ia-screen-tag,
#phone .screen .jk-header-action {
  font-weight: 500 !important;
  letter-spacing: normal;
}
/* Navigation always fits four real destinations, including deep/night state. */
#phone #bottom-nav {
  grid-template-columns: repeat(4, minmax(0,1fr));
  align-items: center;
}
#phone #bottom-nav .navbtn,
#phone #bottom-nav .navbtn.signature {
  min-width: 0;
  min-height: 56px;
  padding: 6px 3px;
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 500 !important;
  letter-spacing: normal;
  text-align: center;
}
#phone #bottom-nav .navbtn.signature span {
  font-weight: 500 !important;
  letter-spacing: normal;
  line-height: 1.35;
}
#phone #bottom-nav .navbtn .ni {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  line-height: 1;
}
#phone #bottom-nav .navbtn .ni svg.jk-icon {
  display: block;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  vertical-align: middle;
}
#phone #bottom-nav .navbtn span:last-child {
  max-width: 100%;
  text-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Preserve SVG paths/colors. Only fix intrinsic box & alignment. */
#phone :is(button, a) > svg.jk-icon,
#phone :is(.iconbtn, .thread-action, .jk-header-action, .entry-quiet) svg.jk-icon {
  display: block;
  flex-shrink: 0;
  vertical-align: middle;
}
#phone :is(.iconbtn, .thread-action, .jk-header-action) {
  align-items: center;
  justify-content: center;
}
#phone .iconbtn svg.jk-icon {
  width: 20px;
  height: 20px;
  margin: auto;
}
#phone .jk-main-topbar > button:has(svg.jk-icon),
#phone .entry-social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* Consistent card information without touching card supply, ranks or behavior. */
#phone .screen[data-screen="meet"] #meet-discovery-row .mpr-person .name {
  font-weight: 600 !important;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: normal;
}
#phone .screen[data-screen="meet"] #meet-discovery-row .mpr-person .person-reason {
  font-weight: 400 !important;
  font-size: 14px !important;
  line-height: 1.65;
}
#phone .screen[data-screen="meet"] #meet-discovery-row .mpr-person :is(.meta,.mpr-area,.badge) {
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.55;
}
#phone .screen[data-screen="meet"] #meet-discovery-row .mpr-person .btn {
  font-size: 14px;
  font-weight: 500 !important;
}
#phone .deep-core-tabs b,
#phone .story-tabs button,
#phone #jk-thread-content .thread-card h3,
#phone #jk-thread-content .thread-chip {
  font-weight: 500 !important;
  letter-spacing: normal;
}
#phone #jk-thread-content .thread-card h3 {
  font-size: 17px;
  line-height: 1.6;
}
#jk-thread-live-dialog,
#jk-thread-dialog,
#jk-story-dialog { line-height: 1.7; }
#jk-thread-live-dialog :is(.jk-live-head h2, .jk-live-post-body, .jk-live-button, .jk-live-topic button) {
  font-weight: 500 !important;
  line-height: 1.65;
  letter-spacing: normal;
}
/* Clean up auth hierarchy without changing identity/consent/providability. */
#phone #entry-account-title {
  font-weight: 600 !important;
  letter-spacing: normal;
  line-height: 1.42;
}
#phone .entry-social-button,
#phone .entry-primary,
#phone .entry-quiet {
  font-weight: 500 !important;
  line-height: 1.5;
}
#phone .entry-provider-svg {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  overflow: visible;
}
/* Reflow small viewports; do not reduce tap targets or hide any functionality. */
@media (max-width: 359px) {
  #phone .screen .jk-main-topbar .h1 { font-size: 22px; }
  #phone #bottom-nav .navbtn { font-size: 11px; }
  #phone .screen[data-screen="meet"] #meet-discovery-row .mpr-person .name { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  #phone :is(.screen, .reader, .entry-flow) { scroll-behavior: auto; }
}


/* P0 visual alignment — treat text chevrons and pictograms as one unit.
   Avoid font glyph baseline offsets (particularly Thai next to > / →). */
#phone .meet-area-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  column-gap: 7px;
  line-height: 1.45;
}
#phone .meet-area-picker > :is(span, svg) { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
#phone .meet-area-picker > :last-child { flex: 0 0 auto; align-self: center; }
#phone .meet-community-bottom button.route {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.45;
}
#phone :is(.deep-feature-cta, .home-story-utilities button, .deep-bridge) :is(svg.jk-icon, .deep-bridge-go),
#phone :is(.home-launch-card, .reentry-go, .jk-social-link) > svg.jk-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  align-self: center;
  vertical-align: middle;
}
#phone .deep-feature-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.45;
}
#phone .deep-feature-cta > .jk-icon { width: 16px; height: 16px; display: inline-block; }
#phone .home-launch-card > .jk-icon { display: block; flex: 0 0 18px; }
#phone .premium-call-contract > i,
#phone .random-flow > i,
#phone .rtc-flow > i {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  align-self: center;
  font-style: normal;
  line-height: 1;
  transform: translateY(-1px);
}
/* Scoped to actual chevron SVG; no path/stroke/color changes. */
#phone svg.jk-icon:has(use[href="#i-chevron-right"]),
#phone svg.jk-icon:has(use[href="#i-chevron-left"]) {
  vertical-align: middle;
  transform: translateY(0);
}
