/* Kinnect 0.4 — giao diện kết hợp: bảng tin kiểu mạng xã hội, video dọc, lưới thành viên */
:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --ink: #1c1e21;
  --muted: #65676b;
  --line: #e4e6eb;
  --soft: #f2f3f5;
  --primary: #6d4aff;
  --primary-ink: #ffffff;
  --primary-soft: #ece8ff;
  --like: #fe2c55;
  --brand-gradient: linear-gradient(135deg, #6d4aff, #fe2c55);
  --radius: 14px;
  --nav-h: 64px;
  color-scheme: light;
}
html,
body {
  background: var(--bg);
  color: var(--ink);
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Đăng nhập ---------- */
#auth.auth-shell {
  background: var(--card);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 10px 40px #0000001a;
  margin: 40px auto;
  max-width: 440px;
  position: relative;
  overflow: hidden;
}
#auth.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--brand-gradient);
}
#auth .auth-tabs {
  background: var(--soft);
}
#auth .auth-tabs button:not(.secondary),
#auth #auth-submit {
  background: var(--primary);
  color: var(--primary-ink);
}
#auth .eyebrow {
  color: var(--primary);
}

/* ---------- Khung ứng dụng ---------- */
main#app {
  max-width: none;
  margin: 0;
  padding: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  display: block;
}
#app button {
  border-radius: 10px;
  font-weight: 600;
  min-height: 40px;
  border: 0;
  cursor: pointer;
}
#app button:not(.secondary):not(.ghost):not(.danger):not(.chip):not(.reel-btn):not(.story):not(.icon-tab):not(.create-tab):not([data-tab]) {
  background: var(--primary);
  color: var(--primary-ink);
}
#app button.secondary {
  background: var(--soft);
  color: var(--ink);
}
#app button.ghost {
  background: transparent;
  color: var(--primary);
}
#app button.follow {
  background: var(--like) !important;
  color: #fff !important;
}
#app input,
#app textarea,
#app select {
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink);
}
#app input:focus,
#app textarea:focus,
#app select:focus {
  outline: 2px solid var(--primary);
  background: #fff;
}
#app .muted,
#app .fine {
  color: var(--muted);
}

/* Thanh trên cùng */
#app > header.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  margin: 0;
  box-shadow: 0 1px 2px #0000000d;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}
.topbar .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.topbar h1 {
  font-size: 22px !important;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(90deg, var(--primary), var(--like));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  letter-spacing: -0.5px;
}
.topbar h1 small {
  display: none;
}
#connection {
  font-size: 11px;
  color: var(--muted);
}
.top-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
#app .icon-tab {
  background: var(--soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
#app .icon-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
}
#app .icon-tab .tab-icon {
  width: 20px;
  height: 20px;
}
#unread:not(:empty) {
  background: var(--like);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 11px;
}
#logout {
  font-size: 13px;
}
#notice {
  max-width: 680px;
  margin: 10px auto 0;
  background: var(--primary-soft);
  color: #3d2a99;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  padding: 8px 12px;
}
#notice:empty {
  display: none;
}

/* Thanh điều hướng dưới (di động) */
#app > nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 4px 4px env(safe-area-inset-bottom);
  margin: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 0;
  backdrop-filter: none;
  overflow: visible;
}
#app > nav [data-tab] {
  flex: 1;
  flex-direction: column;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  padding: 4px 0;
  min-height: 52px;
  border-radius: 12px;
}
#app > nav [data-tab].active {
  color: var(--primary);
  background: transparent;
}
#app > nav .tab-icon {
  width: 24px;
  height: 24px;
}
#app .create-tab {
  flex: 0 0 52px;
  height: 36px;
  min-height: 36px !important;
  margin: 0 6px;
  border-radius: 11px !important;
  background: var(--brand-gradient) !important;
  color: #fff !important;
  font-size: 26px;
  line-height: 1;
  position: relative;
  box-shadow: 0 2px 8px #6d4aff55;
}

/* Nội dung chính */
#social-panel,
#live-panel {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 12px 0;
}
#social-panel > h2 {
  font-size: 22px;
  margin: 8px 4px 4px;
}
#social-panel > p.muted {
  margin: 0 4px 12px;
  font-size: 13px;
}
.sr-title {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
#app .social-card {
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px #0000001a;
  padding: 14px 16px;
  margin-bottom: 12px;
}
#app .avatar {
  border-radius: 50%;
  object-fit: cover;
}
#app .fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #c9b8ff, #ffb3c6);
  color: #fff;
  font-weight: 800;
}
#app > footer {
  max-width: 680px;
  margin: 16px auto;
  padding: 0 16px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Tin (stories) ---------- */
.stories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.stories::-webkit-scrollbar {
  display: none;
}
#app .story {
  flex: 0 0 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  min-height: 0;
  font-weight: 500;
}
#app .story .avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 2.5px var(--primary);
  background-origin: border-box;
}
#app .story:not(.story-me) .avatar {
  box-shadow: 0 0 0 2.5px var(--like);
}
#app .story span:not(.avatar) {
  font-size: 11.5px;
  max-width: 74px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#app .story-me span:not(.avatar) {
  color: var(--primary);
}

/* ---------- Ô soạn bài ---------- */
.composer-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.composer-row .avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}
.composer-row textarea {
  flex: 1;
  min-height: 44px;
  border-radius: 20px !important;
  padding: 10px 14px;
  resize: vertical;
  width: auto;
}
.composer-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
}
.composer-tools select {
  margin-left: auto;
  min-height: 38px !important;
  width: auto;
  font-size: 13px !important;
}
.composer-tools button {
  padding: 0 14px;
}

/* ---------- Bài viết ---------- */
.post-head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.post-head .avatar {
  width: 40px;
  height: 40px;
}
.post-head strong {
  font-size: 15px;
}
.post-head p {
  margin: 2px 0 0;
}
.post-body {
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 12px 0;
}
.post-actions {
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
#app .post-actions button {
  flex: 1;
  background: transparent;
  color: var(--muted);
}
#app .post-actions button:hover {
  background: var(--soft);
}

/* ---------- Khám phá: lưới ảnh ---------- */
.chips {
  display: flex;
  gap: 8px;
  margin: 0 2px 10px;
}
#app .chip {
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 16px;
  box-shadow: 0 1px 2px #0000001a;
}
#app .chip.active {
  background: var(--ink);
  color: #fff;
}
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.search-bar input {
  flex: 1;
  border-radius: 999px !important;
  padding: 0 16px;
}
.search-bar button {
  border-radius: 999px !important;
  padding: 0 18px;
}
#app .people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#app .person-tile {
  padding: 0;
  overflow: hidden;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.tile-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--soft);
}
#app .tile-photo .avatar {
  width: 100%;
  height: 100%;
  border-radius: 0;
  font-size: 56px;
}
.tile-photo::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, #000a);
  pointer-events: none;
}
.tile-name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  z-index: 1;
  color: #fff;
}
#app .tile-name h3 {
  color: #fff;
  font-size: 16px;
  margin: 0;
  text-shadow: 0 1px 3px #0008;
}
#app .tile-name p {
  color: #ffffffcc;
  font-size: 11px;
  margin: 0;
}
.tile-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  background: #000000a0;
  color: #fff;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
}
.person-tile .tile-bio {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 10px 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.person-tile .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 10px;
}
#app .person-tile .tags span {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
}
.person-tile > p.muted {
  font-size: 11.5px;
  margin: 4px 10px 0;
}
#app .person-tile .card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  margin-top: auto;
}
#app .person-tile .card-actions button {
  min-height: 34px;
  font-size: 12px;
  padding: 0 6px;
}
#app .person-tile .card-actions button:nth-child(n + 3) {
  background: transparent;
  color: var(--muted);
  min-height: 26px;
  font-weight: 500;
  font-size: 11px;
}

/* ---------- Video dọc ---------- */
body[data-view="shorts"] {
  background: #000;
}
body[data-view="shorts"] #notice,
body[data-view="shorts"] #app > footer {
  display: none;
}
body[data-view="shorts"] #social-panel {
  max-width: 520px;
  padding: 0;
}
.short-upload {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: #111;
}
#app .short-upload input {
  background: #222;
  color: #fff;
  min-height: 38px;
  font-size: 13px !important;
}
#app .short-upload input[type="file"] {
  max-width: 42%;
}
#app .short-upload input:not([type="file"]) {
  flex: 1;
  min-width: 0;
}
.reel {
  height: calc(100dvh - var(--nav-h) - 54px - 54px - env(safe-area-inset-bottom));
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.reel::-webkit-scrollbar {
  display: none;
}
.reel-item {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
}
.reel-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reel-meta {
  position: absolute;
  left: 14px;
  right: 76px;
  bottom: 18px;
  color: #fff;
  text-shadow: 0 1px 3px #000a;
}
.reel-meta p {
  margin: 4px 0 0;
  font-size: 14px;
}
.reel-side {
  position: absolute;
  right: 10px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
#app .reel-side .avatar {
  width: 48px;
  height: 48px;
  border: 2px solid #fff;
  font-size: 20px;
}
#app .reel-btn {
  background: #ffffff26;
  color: #fff;
  width: 52px;
  min-height: 52px;
  border-radius: 50%;
  font-size: 15px;
  backdrop-filter: blur(6px);
}
#app .reel-btn.on {
  color: var(--like);
  background: #fff;
}
.reel-empty {
  color: #ddd;
  text-align: center;
  padding-top: 40%;
}

/* ---------- Tin nhắn ---------- */
#app .dm-log {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
}
#app .bubble {
  border-radius: 18px;
  background: var(--soft);
  border: 0;
}
#app .bubble.mine {
  background: var(--primary);
  color: #fff;
}
#app .bubble.mine small {
  color: #ffffffbb;
}
#app .dm-compose {
  display: flex;
  gap: 8px;
}
#app .dm-compose input {
  flex: 1;
  border-radius: 999px;
}

/* ---------- Cột gợi ý (máy tính) ---------- */
#rail {
  display: none;
}
#rail h3 {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 10px;
}
.rail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
#app .rail-row .avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}
.rail-row div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.rail-row small {
  color: var(--muted);
  font-size: 12px;
}
#app .wide {
  width: 100%;
}

/* ---------- Máy tính: 3 cột ---------- */
@media (min-width: 1000px) {
  :root {
    --nav-h: 0px;
  }
  main#app {
    display: grid;
    grid-template-columns: 260px minmax(0, 680px) 300px;
    justify-content: center;
    column-gap: 28px;
    grid-template-areas:
      "top top top"
      "nav notice rail"
      "nav main rail"
      "nav foot rail";
    grid-template-rows: auto auto 1fr auto;
    padding-bottom: 0;
  }
  #app > header.topbar {
    grid-area: top;
  }
  #notice {
    grid-area: notice;
    width: 100%;
  }
  #social-panel,
  #live-panel {
    grid-area: main;
    width: 100%;
    max-width: none;
  }
  #app > footer {
    grid-area: foot;
  }
  #app > nav {
    grid-area: nav;
    position: sticky;
    top: 70px;
    height: auto;
    align-self: start;
    flex-direction: column;
    align-items: stretch;
    background: transparent;
    border: 0;
    padding: 12px 0;
    gap: 2px;
  }
  #app > nav [data-tab] {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    font-size: 15px;
    padding: 0 12px;
    min-height: 48px;
    color: var(--ink);
  }
  #app > nav [data-tab]:hover {
    background: #e4e6e9;
  }
  #app > nav [data-tab].active {
    background: var(--primary-soft);
  }
  #app .create-tab {
    order: 10;
    flex: 0 0 auto;
    margin: 12px 0 0;
    height: 44px;
    min-height: 44px !important;
    font-size: 15px;
  }
  #app .create-tab span::after {
    content: "  Tạo bài viết";
  }
  #rail {
    display: block;
    grid-area: rail;
    position: sticky;
    top: 82px;
    align-self: start;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px #0000001a;
    padding: 16px;
    margin-top: 12px;
  }
  #app .people-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .reel {
    height: calc(100dvh - 70px - 54px);
    border-radius: var(--radius);
  }
  body[data-view="shorts"] #rail {
    background: #111;
    color: #eee;
  }
  body[data-view="shorts"] #app > nav [data-tab] {
    color: #ddd;
  }
  body[data-view="shorts"] #app > nav [data-tab]:hover {
    background: #222;
  }
}

/* ---------- Chế độ tối ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18191a;
    --card: #242526;
    --ink: #e4e6eb;
    --muted: #b0b3b8;
    --line: #3a3b3c;
    --soft: #3a3b3c;
    --primary: #8b6dff;
    --primary-soft: #2e2752;
    color-scheme: dark;
  }
  #notice {
    color: #d6ccff;
  }
  #app input:focus,
  #app textarea:focus,
  #app select:focus {
    background: #18191a;
  }
  #app .chip.active {
    background: #e4e6eb;
    color: #18191a;
  }
  #auth.auth-shell h1,
  #auth.auth-shell label {
    color: var(--ink);
  }
}

/* Sửa chi tiết */
#app .rail-row small {
  background: none;
  padding: 0;
  display: block;
}
#app > header.topbar {
  flex-wrap: nowrap;
}
#app > header.topbar #logout {
  white-space: nowrap;
  font-size: 12px;
  padding: 0 10px;
}
@media (max-width: 999px) {
  #connection {
    display: none;
  }
  #app .icon-tab {
    font-size: 0;
    width: 40px;
    padding: 0;
    justify-content: center;
    position: relative;
  }
  #app .icon-tab #unread:not(:empty) {
    font-size: 10px;
    position: absolute;
    top: -2px;
    right: -4px;
  }
  .topbar h1 {
    font-size: 20px !important;
  }
}

/* Nhận diện thiết bị */
.android-banner {
  background: #e8f5e9;
  border-color: #c8e6c9;
}
.banner-cta {
  background: #2e7d32;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.platforms {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.platforms h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.platform {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: var(--soft) !important;
  color: var(--ink) !important;
  text-decoration: none;
  font: inherit;
  border: 0;
  cursor: pointer;
  box-sizing: border-box;
}
.platform small {
  color: var(--muted);
  font-weight: 400;
}
.platform-note {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
html[data-platform="android"] .platform:first-of-type,
html[data-platform="ios"] .platforms button.platform {
  outline: 2px solid var(--primary);
}
#app .platform small,
#auth .platform small {
  background: none !important;
  padding: 0;
  text-align: right;
}
.platform b {
  text-align: left;
}

/* ---------- Màn hình giới thiệu ---------- */
body.ob-open {
  overflow: hidden;
}
.onboarding {
  margin: 0;
  max-width: none;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 70% at 50% 0%, #efe9ff 0%, var(--bg) 60%);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  color: var(--ink);
}
.ob-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.ob-top img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.ob-top strong {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--like));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ob-skip {
  margin-left: auto;
  background: transparent !important;
  color: var(--muted) !important;
  font-weight: 600;
  min-height: 40px;
  border: 0;
  cursor: pointer;
}
.ob-track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}
.ob-track::-webkit-scrollbar {
  display: none;
}
.ob-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 28px;
  box-sizing: border-box;
}
.ob-slide h2 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin: 6px 0 10px;
  color: var(--ink);
}
.ob-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin: 22px 0 0;
}
.ob-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 380px;
  margin: 0;
}
.ob-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 0;
}
.ob-dots button {
  width: 8px;
  height: 8px;
  min-height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c9c5d6 !important;
  transition: width 0.2s;
  cursor: pointer;
}
.ob-dots button[aria-selected="true"] {
  width: 24px;
  background: var(--primary) !important;
}
.ob-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 24px 24px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.ob-actions button {
  min-height: 52px;
  border-radius: 14px;
  border: 0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.ob-start {
  background: var(--brand-gradient) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px #6d4aff40;
}
.ob-login {
  background: transparent !important;
  color: var(--ink) !important;
}

/* Hình minh họa */
.onboarding {
  overflow: hidden;
  background: linear-gradient(180deg, #f7f5ff 0%, var(--bg) 70%);
}
.ob-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
  animation: ob-drift 14s ease-in-out infinite alternate;
}
.ob-blob.b1 {
  width: 420px;
  height: 420px;
  background: #8b6dff;
  top: -160px;
  left: -140px;
}
.ob-blob.b2 {
  width: 380px;
  height: 380px;
  background: #ff5c7a;
  bottom: 60px;
  right: -180px;
  opacity: 0.35;
  animation-delay: -6s;
}
@keyframes ob-drift {
  to {
    transform: translate(60px, 40px) scale(1.1);
  }
}
.ob-top,
.ob-track,
.ob-dots,
.ob-actions {
  position: relative;
  z-index: 1;
}
.ob-art {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.ob-phone {
  width: 236px;
  height: 420px;
  border-radius: 38px;
  background: #fff;
  border: 0;
  box-shadow:
    0 0 0 9px #15161a,
    0 0 0 10px #3a3b40,
    0 40px 80px -20px #2a1d6655,
    0 20px 40px -20px #0005;
  padding: 18px 12px 12px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #1c1e21;
  font-size: 11px;
  text-align: left;
  transform: translateY(12px) scale(0.97);
  opacity: 0.6;
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.6s;
}
.ob-phone::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 70px;
  height: 18px;
  margin-left: -35px;
  border-radius: 999px;
  background: #15161a;
  z-index: 3;
}
.is-active .ob-phone {
  transform: none;
  opacity: 1;
}
.mk-av {
  --h: 260;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 80% 68%), hsl(calc(var(--h) + 40) 85% 60%));
}
.mk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.mk-bar b {
  font-size: 15px;
  margin-right: auto;
  background: linear-gradient(90deg, #6d4aff, #fe2c55);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mk-bar i {
  font-style: normal;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f0f2f5;
  display: grid;
  place-items: center;
  font-size: 11px;
}
.mk-stories {
  display: flex;
  gap: 8px;
}
.mk-stories .mk-av {
  width: 38px;
  height: 38px;
  font-size: 14px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #fe2c55;
}
.mk-stories .mk-av:first-child {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #6d4aff;
}
.mk-post {
  border-radius: 14px;
  box-shadow: 0 2px 10px #0000001a;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.mk-head {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mk-head p,
.mk-chat-head p {
  margin: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.mk-head small,
.mk-chat-head small {
  color: #65676b;
  font-size: 9.5px;
}
.mk-text {
  margin: 0;
  line-height: 1.4;
}
.mk-photo {
  flex: 1;
  border-radius: 10px;
  background:
    radial-gradient(circle at 75% 30%, #ffe0a3 0 14%, transparent 15%),
    linear-gradient(180deg, #a5b4fc 0%, #f9a8d4 60%, #7c5a46 61%, #4a3428 100%);
}
.mk-actions {
  display: flex;
  justify-content: space-between;
  color: #65676b;
  font-weight: 600;
  font-size: 10px;
  border-top: 1px solid #eee;
  padding-top: 6px;
}
.mk-actions span:first-child {
  color: #fe2c55;
}

/* Video */
.ob-dark {
  background: #000 !important;
  color: #fff !important;
  padding: 0 !important;
}
.mk-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 40% at 30% 30%, #6d4affcc, transparent),
    radial-gradient(60% 45% at 75% 70%, #fe2c55aa, transparent),
    linear-gradient(180deg, #1b1340, #0b0a12);
  animation: ob-pulse 6s ease-in-out infinite alternate;
}
@keyframes ob-pulse {
  to {
    filter: hue-rotate(25deg) brightness(1.15);
  }
}
.mk-tabs {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  font-size: 11px;
  color: #ffffffaa;
}
.mk-tabs b {
  color: #fff;
  border-bottom: 2px solid #fff;
  padding-bottom: 3px;
}
.mk-play {
  position: relative;
  z-index: 2;
  margin: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ffffff2a;
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.mk-side {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mk-side .mk-av {
  width: 36px;
  height: 36px;
  box-shadow: 0 0 0 2px #fff;
}
.mk-side i {
  font-style: normal;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 18px;
  line-height: 1;
}
.mk-side i small {
  font-size: 9px;
  margin-top: 3px;
  font-weight: 700;
}
.mk-side i.on {
  color: #fe2c55;
  animation: ob-beat 1.4s ease-in-out infinite;
}
.mk-side i.on small {
  color: #fff;
}
@keyframes ob-beat {
  50% {
    transform: scale(1.18);
  }
}
.mk-cap {
  position: absolute;
  z-index: 2;
  left: 12px;
  right: 56px;
  bottom: 22px;
}
.mk-cap p {
  margin: 4px 0;
  line-height: 1.35;
}
.mk-sound {
  font-size: 9.5px;
  opacity: 0.85;
}
.mk-progress {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #ffffff33;
}
.mk-progress i {
  display: block;
  height: 100%;
  width: 40%;
  background: #fff;
  animation: ob-progress 5s linear infinite;
}
@keyframes ob-progress {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Khám phá */
.mk-chips {
  display: flex;
  gap: 6px;
}
.mk-chips b,
.mk-chips span {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
}
.mk-chips b {
  background: #1c1e21;
  color: #fff;
}
.mk-chips span {
  background: #f0f2f5;
  font-weight: 600;
}
.mk-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.mk-tile {
  --h: 260;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, hsl(var(--h) 70% 85%) 0 22%, transparent 23%),
    radial-gradient(ellipse at 50% 100%, hsl(var(--h) 60% 78%) 0 48%, transparent 49%),
    linear-gradient(180deg, hsl(var(--h) 75% 70%), hsl(calc(var(--h) + 35) 80% 62%));
}
.mk-tile::after {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent, #0009);
}
.mk-tile p {
  position: absolute;
  z-index: 1;
  left: 7px;
  bottom: 6px;
  margin: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.mk-tile small {
  font-size: 8.5px;
  opacity: 0.9;
}
.mk-tile em {
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 6px;
  font-style: normal;
  font-size: 8.5px;
  font-weight: 700;
  color: #fff;
  background: #0007;
  padding: 2px 6px;
  border-radius: 999px;
}

/* Chat */
.mk-chat-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}
.mk-chat-head small {
  color: #22a861;
}
.mk-msgs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mk-msgs p {
  margin: 0;
  max-width: 78%;
  padding: 7px 10px;
  line-height: 1.35;
  border-radius: 14px 14px 14px 4px;
  background: #f0f2f5;
}
.mk-msgs .out {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, #6d4aff, #9b5cff);
  color: #fff;
}
.mk-msgs .typing {
  display: flex;
  gap: 3px;
  width: auto;
  padding: 9px 10px;
}
.mk-msgs .typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #999;
  animation: ob-typing 1.2s infinite;
}
.mk-msgs .typing i:nth-child(2) {
  animation-delay: 0.2s;
}
.mk-msgs .typing i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes ob-typing {
  50% {
    transform: translateY(-3px);
    opacity: 0.4;
  }
}
.mk-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0f2f5;
  border-radius: 999px;
  padding: 7px 7px 7px 12px;
  color: #8a8d91;
}
.mk-input b {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #6d4aff;
  font-size: 10px;
}
.mk-live {
  background: #fe2c55;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  margin-right: 4px;
}

/* Nhãn nổi */
.ob-float {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 14px;
  background: #ffffffee;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -8px #2a1d6640;
  font-size: 12px;
  font-weight: 700;
  color: #1c1e21;
  white-space: nowrap;
  opacity: 0;
  transition:
    opacity 0.5s 0.25s,
    transform 0.6s 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ob-float .mk-av {
  width: 22px;
  height: 22px;
  font-size: 10px;
}
.ob-float.f1 {
  top: 18%;
  left: calc(50% - 205px);
  transform: translateX(-16px);
}
.ob-float.f2 {
  bottom: 14%;
  right: calc(50% - 215px);
  transform: translateX(16px);
}
.is-active .ob-float {
  opacity: 1;
  transform: none;
  animation: ob-bob 4s ease-in-out 1s infinite alternate;
}
.is-active .ob-float.f2 {
  animation-delay: 2s;
}
@keyframes ob-bob {
  to {
    transform: translateY(-6px);
  }
}
.ob-copy h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.8px;
}
.ob-eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: #6d4aff1a;
}

@media (max-width: 480px) {
  .ob-float.f1 {
    left: 8px;
  }
  .ob-float.f2 {
    right: 8px;
  }
  .ob-float {
    font-size: 11px;
    padding: 7px 10px;
  }
}
@media (max-height: 760px) {
  .ob-phone {
    width: 196px;
    height: 330px;
  }
  .ob-copy h2 {
    font-size: 24px;
  }
  .ob-eyebrow {
    margin-top: 10px;
  }
}
@media (min-width: 1000px) {
  .ob-track,
  .ob-top {
    max-width: 1080px;
  }
  .ob-actions {
    max-width: 1080px;
    flex-direction: row;
    justify-content: flex-end;
    padding-right: 60px;
  }
  .ob-actions button {
    min-width: 220px;
  }
  .ob-slide {
    flex-direction: row;
    gap: 60px;
    text-align: left;
    padding: 0 60px;
  }
  .ob-art {
    flex: 1;
  }
  .ob-copy {
    flex: 1;
  }
  .ob-copy h2 {
    font-size: 46px;
    line-height: 1.1;
    letter-spacing: -1.5px;
  }
  .ob-text {
    font-size: 17px;
  }
  .ob-phone {
    width: 260px;
    height: 470px;
  }
  .ob-float.f1 {
    left: calc(50% - 230px);
  }
  .ob-float.f2 {
    right: calc(50% - 240px);
  }
  .ob-dots {
    justify-content: flex-start;
    padding-left: max(60px, calc(50% - 480px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .ob-blob,
  .mk-glow,
  .mk-side i.on,
  .mk-progress i,
  .mk-msgs .typing i,
  .is-active .ob-float {
    animation: none !important;
  }
}
@media (prefers-color-scheme: dark) {
  .onboarding {
    background: linear-gradient(180deg, #1d1838 0%, var(--bg) 70%);
  }
  .ob-float {
    background: #242526ee;
    color: #e4e6eb;
  }
}
.onboarding small {
  background: none !important;
  padding: 0 !important;
  border: 0 !important;
}
.ob-track {
  min-height: 0;
}
.ob-slide {
  justify-content: center;
  gap: 4px;
  min-height: 0;
}
@media (max-width: 999px) {
  .ob-phone {
    width: 200px;
    height: 340px;
    font-size: 10px;
  }
  .ob-float.f1 {
    top: auto;
    bottom: 58%;
  }
  .ob-copy h2 {
    font-size: 26px;
    margin: 4px 0 6px;
  }
  .ob-text {
    font-size: 14px;
  }
  .ob-eyebrow {
    margin-top: 14px;
  }
}
@media (max-width: 999px) and (max-height: 760px) {
  .ob-phone {
    width: 170px;
    height: 280px;
  }
  .mk-photo {
    display: none;
  }
}

/* ---------- Đăng nhập gần đây (kiểu Facebook) ---------- */
#auth.has-recent .auth-panel > :not(.auth-logo):not(.recent-accounts):not(.site-links) {
  display: none !important;
}
.recent-accounts h2 {
  font-size: 24px;
  margin: 18px 0 2px;
  color: var(--ink);
}
.recent-accounts > .muted {
  margin: 0 0 14px;
  font-size: 14px;
}
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.recent-item {
  display: flex;
  align-items: center;
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 1px 3px #0000001f;
  overflow: hidden;
}
.recent-pick {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px !important;
  min-height: 68px;
  background: transparent !important;
  color: var(--ink) !important;
  text-align: left;
  border: 0;
  cursor: pointer;
}
.recent-pick:hover {
  background: var(--soft) !important;
}
.recent-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #8b6dff, #fe2c55);
}
.recent-name {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.recent-name b {
  font-size: 16px;
}
.recent-name small {
  color: var(--muted);
  font-size: 12.5px;
  background: none !important;
  padding: 0 !important;
}
.recent-remove {
  width: 44px;
  min-height: 44px;
  margin-right: 8px;
  border-radius: 50% !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 20px;
  border: 0;
  cursor: pointer;
}
.recent-other,
.recent-create {
  width: 100%;
  min-height: 48px;
  border-radius: 12px !important;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  margin-top: 8px;
}
.recent-other {
  background: var(--soft) !important;
  color: var(--ink) !important;
}
.recent-create {
  background: transparent !important;
  color: var(--primary) !important;
  border: 1.5px solid var(--primary) !important;
}

/* ---------- Trang chào mở đầu ---------- */
.ob-hero {
  position: relative;
  width: 300px;
  height: 300px;
  display: grid;
  place-items: center;
}
.ob-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px dashed #6d4aff55;
  animation: ob-spin 40s linear infinite;
}
.ob-ring.r1 {
  inset: 30px;
}
.ob-ring.r2 {
  inset: -10px;
  border-color: #fe2c5540;
  animation-direction: reverse;
  animation-duration: 60s;
}
@keyframes ob-spin {
  to {
    transform: rotate(360deg);
  }
}
.ob-hero::before {
  content: "";
  position: absolute;
  inset: 70px;
  border-radius: 50%;
  background: var(--brand-gradient);
  filter: blur(30px);
  opacity: 0.45;
}
.ob-hero-logo {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 30px;
  box-shadow: 0 20px 40px -10px #2a1d6680, 0 0 0 6px #ffffffcc;
  animation: ob-float 5s ease-in-out infinite alternate;
}
@keyframes ob-float {
  to {
    transform: translateY(-8px) rotate(-3deg);
  }
}
.ob-orbit {
  position: absolute;
}
.ob-orbit .mk-av {
  width: 46px;
  height: 46px;
  font-size: 17px;
  box-shadow: 0 0 0 3px #fff, 0 10px 20px -6px #2a1d6655;
}
.ob-orbit.o1 { top: 6px; left: 50%; margin-left: -23px; }
.ob-orbit.o2 { top: 70px; right: 0; }
.ob-orbit.o3 { bottom: 40px; right: 24px; }
.ob-orbit.o4 { bottom: 40px; left: 24px; }
.ob-orbit.o5 { top: 70px; left: 0; }
.ob-orbit.o2 .mk-av, .ob-orbit.o4 .mk-av { width: 38px; height: 38px; font-size: 14px; }
.ob-hero-chip {
  position: absolute;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #1c1e21;
  white-space: nowrap;
  box-shadow: 0 12px 26px -8px #2a1d6650;
  animation: ob-bob 4s ease-in-out infinite alternate;
}
.ob-hero-chip.c1 { top: 24px; left: -30px; }
.ob-hero-chip.c2 { bottom: 0; left: 50%; transform: translateX(-50%); color: var(--like); animation-delay: -1.5s; }
.ob-hero-chip.c3 { top: 150px; right: -48px; animation-delay: -3s; }
.ob-hero-chip.c3::first-letter { color: #22c55e; }
@media (max-width: 999px) {
  .ob-hero { transform: scale(0.85); margin: -20px 0; }
}
@media (max-width: 999px) and (max-height: 760px) {
  .ob-hero { transform: scale(0.7); margin: -45px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ob-ring, .ob-hero-logo, .ob-hero-chip { animation: none !important; }
}

/* ---------- Liên kết sang website ---------- */
.site-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 14px;
  font-size: 12.5px;
}
.site-links a {
  color: var(--muted);
  text-decoration: none;
}
.site-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.ob-site {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 8px 4px;
}
.ob-site + .ob-skip {
  margin-left: 4px;
}

/* ---------- Màn chờ khi đang kiểm tra đăng nhập ---------- */
#auth[hidden],
#app[hidden] {
  display: none !important;
}
body:has(#auth[hidden]):has(#app[hidden])::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1500;
  background:
    url("/kinnect-icon.png?v=3") center calc(50% - 10px) / 84px 84px no-repeat,
    radial-gradient(120% 70% at 50% 0%, #efe9ff 0%, var(--bg) 60%);
  animation: boot-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes boot-pulse {
  to {
    background-size: 92px 92px, auto;
  }
}
body.ob-open::before {
  display: none;
}
#app > footer nav.site-links,
#auth nav.site-links {
  position: static;
  background: none;
  border: 0;
  padding: 0;
  backdrop-filter: none;
  box-shadow: none;
  display: flex;
}

/* ================= Màn đăng nhập / đăng ký (thiết kế mới) ================= */
body:has(#auth:not([hidden])) {
  padding-top: 0;
  background: var(--bg);
}
#auth.auth-shell {
  all: unset;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100dvh;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#auth.auth-shell::before {
  display: none;
}
#auth[hidden] {
  display: none !important;
}
/* Nửa trái: thương hiệu */
.auth-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #6d4aff 0%, #b23cf0 55%, #fe2c55 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
}
.auth-brand::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 80px solid #ffffff12;
  right: -200px;
  bottom: -160px;
}
.auth-brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
}
.auth-brand-top img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 0 0 3px #ffffff55;
}
.auth-brand h2 {
  font-size: clamp(34px, 3.4vw, 48px);
  line-height: 1.08;
  letter-spacing: -1.4px;
  margin: 48px 0 20px;
  color: #fff;
}
.auth-brand ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  font-size: 17px;
}
.auth-brand li {
  display: flex;
  gap: 10px;
  align-items: center;
}
.auth-brand li::before {
  content: "✓";
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: #ffffff2e;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}
.auth-phone {
  position: relative;
  margin: auto 0 -140px 40px;
  width: 280px;
  aspect-ratio: 390 / 844;
  border-radius: 44px;
  padding: 10px;
  background: #121318;
  box-shadow: 0 40px 80px -20px #0007;
  transform: rotate(-4deg);
  align-self: center;
}
.auth-phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 35px;
}
/* Nửa phải: form */
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 48px 28px;
  box-sizing: border-box;
}
#auth .auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: 0 10px 24px -10px #6d4aff99;
}
#auth .auth-panel h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin: 22px 0 6px;
  color: var(--ink);
}
.auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
}
#auth .auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 0 22px;
  border-radius: 14px;
  background: var(--soft);
}
#auth .auth-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: 700 15px/1 inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
#auth .auth-tabs button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px #0000001f;
}
#auth form {
  display: grid;
  gap: 16px;
}
#auth fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
#auth fieldset[hidden] {
  display: none;
}
#auth .field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap svg {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
#auth .input-wrap input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px 0 44px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px !important;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#auth .input-wrap input::placeholder {
  color: #9a9cab;
}
#auth .input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px #6d4aff22;
  background: var(--card);
}
#auth .input-wrap input:user-invalid {
  border-color: var(--like);
}
#auth #password {
  padding-right: 64px;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  min-height: 40px !important;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent !important;
  color: var(--primary) !important;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.pw-toggle:hover {
  background: var(--soft) !important;
}
#auth .hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
#auth .check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}
#auth .check input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 1px 0 0;
  flex: 0 0 20px;
  accent-color: var(--primary);
}
#auth .check a {
  color: var(--primary);
}
#auth #auth-status {
  margin: 0;
  font-size: 14.5px;
  color: #b4123a;
}
#auth #auth-status:not(:empty) {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff0f3;
  border: 1px solid #ffc9d4;
}
#auth #auth-status:not(:empty)::before {
  content: "⚠ ";
}
#auth #auth-submit {
  min-height: 52px;
  margin: 2px 0 0;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #6d4aff, #fe2c55);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px #6d4affaa;
  transition: transform 0.15s, filter 0.15s;
}
#auth #auth-submit:hover {
  filter: brightness(1.06);
}
#auth #auth-submit:active {
  transform: translateY(1px);
}
#auth #auth-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}
.auth-switch {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.auth-switch button {
  border: 0;
  background: none !important;
  color: var(--primary) !important;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  padding: 0 4px;
}
#auth .fine {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
#auth .site-links {
  margin-top: 16px;
  font-size: 13.5px;
}
#auth .site-links a {
  padding: 8px 2px;
}
#auth .ios-help-trigger {
  align-self: center;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--primary);
}
#auth .ios-help-trigger[hidden] {
  display: none;
}
#auth .recent-accounts h2 {
  margin-top: 22px;
}
@media (max-width: 900px) {
  #auth.auth-shell {
    grid-template-columns: 1fr;
    background: radial-gradient(120% 50% at 50% 0%, #efe9ff 0%, var(--bg) 70%);
  }
  .auth-brand {
    display: none;
  }
  .auth-panel {
    justify-content: flex-start;
    padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  }
  #auth .auth-panel h1 {
    font-size: 28px;
    margin-top: 18px;
  }
}
@media (prefers-color-scheme: dark) {
  #auth #auth-status:not(:empty) {
    background: #3a1420;
    border-color: #6b2235;
    color: #ffb3c3;
  }
  #auth .auth-tabs button.active {
    background: #3a3b3c;
  }
}
#auth .auth-tabs button,
#auth .auth-tabs button.secondary {
  background: transparent !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}
#auth .auth-tabs button.active {
  background: var(--card) !important;
  color: var(--ink) !important;
  box-shadow: 0 1px 3px #0000001f !important;
}
#auth .hint,
#auth small {
  background: none !important;
  padding: 0 !important;
  border: 0 !important;
}
#auth .recent-other {
  background: var(--card) !important;
  box-shadow: inset 0 0 0 1.5px var(--line) !important;
}

/* ---------- Quên mật khẩu ---------- */
#auth .link-btn {
  border: 0;
  background: none !important;
  color: var(--primary) !important;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 0 0;
  min-height: 0;
  box-shadow: none !important;
}
#auth .link-btn[hidden] {
  display: none;
}
#auth #forgot-link {
  float: right;
}
#auth .link-btn.back {
  padding: 0 0 14px;
}
#forgot-view[hidden],
#auth form[hidden],
#auth .auth-tabs[hidden],
#auth .auth-switch[hidden],
.forgot-done[hidden] {
  display: none !important;
}
#auth #forgot-status {
  margin: 0;
  font-size: 14.5px;
  color: #b4123a;
}
#auth #forgot-status:not(:empty) {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff0f3;
  border: 1px solid #ffc9d4;
}
#auth .auth-cta {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #6d4aff, #fe2c55) !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px #6d4affaa;
}
.forgot-done {
  text-align: center;
  padding: 10px 0;
}
.forgot-done .done-ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
}
.forgot-done h2 {
  font-size: 24px;
  margin: 0 0 8px;
  color: var(--ink);
}
.forgot-done p {
  color: var(--muted);
  margin: 0 0 20px;
}

/* ---------- Đăng nhập bằng Google / Facebook ---------- */
#social-login[hidden],
#oauth-form[hidden],
#auth .social-btn[hidden] {
  display: none !important;
}
.social-login {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}
#auth .social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  font-size: 15.5px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#auth .social-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px -10px #2a1d6666;
}
#auth .social-btn svg {
  width: 22px;
  height: 22px;
}
#auth .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}
#auth .divider::before,
#auth .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
#oauth-form {
  display: grid;
  gap: 16px;
}
.oauth-hello {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ecfdf3;
  border: 1px solid #b7ebcb;
  color: #11683a;
  font-size: 14.5px;
}
.oauth-hello::before {
  content: "✓ ";
  font-weight: 800;
}
#auth #oauth-status {
  margin: 0;
  color: #b4123a;
  font-size: 14.5px;
}
#auth #oauth-status:not(:empty) {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff0f3;
  border: 1px solid #ffc9d4;
}
#auth #oauth-cancel {
  justify-self: center;
}
