@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;700;800&display=swap');

:root {
  --bg: #faf5ff;
  --paper: #ffffff;
  --ink: #3b176f;
  --muted: #75618f;
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --accent: #22c55e;
  --line: #e9d5ff;
  --danger: #dc2626;
  --shadow: 0 18px 45px rgba(76, 29, 149, .13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(167, 139, 250, .35), transparent 32rem),
    linear-gradient(180deg, #fff 0%, var(--bg) 48%, #fff 100%);
  font-family: "Noto Sans Thai", system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 128px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 0;
  background: rgba(250, 245, 255, .86);
  backdrop-filter: blur(18px);
}

.back-btn {
  position: absolute;
  left: 0;
  min-height: 42px;
  padding: 0 16px;
  border: 2px solid #e9d5ff;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--primary-dark);
  font-weight: 800;
  cursor: pointer;
  transition: .2s ease;
}

.back-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, .2);
}

.brand {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(124, 58, 237, .18);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 50;
  width: min(760px, calc(100% - 24px));
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: clamp(6px, 2vw, 16px);
  padding: 12px;
  border: 1px solid rgba(233, 213, 255, .9);
  border-radius: 26px;
  background: rgba(250, 245, 255, .88);
  box-shadow: 0 18px 48px rgba(76, 29, 149, .18);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  position: relative;
  min-height: 64px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: left;
  line-height: 1.1;
  gap: 10px;
  padding: 8px clamp(10px, 2.4vw, 18px);
  border: 2px solid #e9d5ff;
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  color: var(--primary-dark);
  font-size: clamp(.72rem, 2vw, .92rem);
  font-weight: 700;
  letter-spacing: .01em;
  transition: .2s ease;
}

.bottom-nav a > span:not(.nav-badge) {
  display: inline-block;
  text-align: left;
  word-break: break-word;
  flex: 0 1 auto;
}

.bottom-nav .nav-icon {
  width: clamp(28px, 6vw, 34px);
  height: clamp(28px, 6vw, 34px);
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(124, 58, 237, .18));
}

.nav-badge {
  position: absolute;
  top: -7px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .72rem;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(239, 68, 68, .24);
}

.bottom-nav a:hover,
.primary-btn:hover,
.account-actions a:hover,
.account-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, .2);
}

.hero {
  min-height: 360px;
  display: grid;
  align-items: center;
  margin: 18px 0 32px;
  padding: clamp(28px, 5vw, 58px);
  border: 3px solid #111;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(250, 245, 255, .92)),
    linear-gradient(90deg, var(--primary), #f472b6);
  box-shadow: 10px 12px 0 #ec4899;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #e11d48;
  font-weight: 800;
  letter-spacing: 0;
}

.hero h1,
.page-title h1,
.article-detail h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p:last-child,
.page-title p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.12rem;
}

.section,
.page-title,
.article-detail,
.review-detail,
.chat-page,
.auth-panel {
  margin: 34px 0;
}

.section-head h2,
.page-title h1 {
  color: #ef4444;
}

.theme-grid,
.model-grid,
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.theme-card,
.model-card,
.video-card,
.article-row,
.form-card,
.list-card,
.comment-box {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.theme-card {
  min-height: 190px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-color: #111;
  box-shadow: 8px 8px 0 #a3e635;
  transition: .2s ease;
}

.theme-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.theme-card h3,
.model-card h2,
.video-card h2,
.article-row h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.theme-card p,
.model-card p,
.video-card p,
.article-row p {
  margin: 0;
  color: var(--muted);
}

.article-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px;
  margin-bottom: 16px;
}

.article-row img,
.model-card img,
.poster,
.static-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.article-detail {
  max-width: 850px;
  margin-inline: auto;
  padding: 10px 0;
}

.detail-cover {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 22px;
}

.body-text {
  color: #4b326e;
  font-size: 1.08rem;
  line-height: 1.8;
}

.model-card,
.video-card {
  overflow: hidden;
  transition: .2s ease;
}

.model-card div,
.video-card h2,
.video-card p {
  padding: 0 16px 16px;
}

.model-card h2 {
  padding-top: 16px;
}

.profile-detail {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(260px, .95fr);
  gap: 26px;
  align-items: start;
  margin: 34px 0;
}

.carousel {
  position: relative;
  overflow: hidden;
  border: 2px solid #111;
  border-radius: 8px;
  background: #fff;
  box-shadow: 8px 8px 0 #a3e635;
}

.slides {
  aspect-ratio: 3 / 4;
}

.slide {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide.active {
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--primary-dark);
  font-size: 1.8rem;
  cursor: pointer;
}

.carousel-btn.prev {
  left: 12px;
}

.carousel-btn.next {
  right: 12px;
}

.profile-info {
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.profile-info dl {
  display: grid;
  gap: 12px;
}

.profile-info dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.profile-info dt {
  color: var(--muted);
}

.profile-info dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.poster {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fbbf24;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-placeholder {
  font-size: 1.4rem;
  font-weight: 800;
  color: #111;
}

.play-mark {
  position: absolute;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--primary-dark);
}

.review-detail video {
  width: min(860px, 100%);
  max-height: 70vh;
  margin: 0 auto 18px;
  background: #111;
  border-radius: 8px;
}

.comment-box {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.review-comment {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.review-comment strong {
  color: var(--primary-dark);
}

.review-comment span {
  color: var(--muted);
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
  gap: 14px;
  margin: 24px 0 16px;
  padding: 18px;
  border: 1px solid rgba(233, 213, 255, .9);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .45)),
    linear-gradient(135deg, #dbeafe 0%, #f5d0fe 58%, #fff 100%);
  box-shadow: 0 18px 40px rgba(76, 29, 149, .12);
}

.account-hero > div {
  min-width: 0;
}

.account-hero span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.account-hero strong {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--primary-dark);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.account-name {
  display: grid;
  align-content: start;
  justify-items: end;
  text-align: right;
}

.account-name p {
  margin: 4px 0 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 800;
}

.account-name b {
  display: inline-block;
  min-width: 92px;
  padding: 7px 22px;
  border-radius: 999px;
  background: #facc15;
  color: var(--primary-dark);
  text-align: center;
  line-height: 1;
}

.balance {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}

.balance strong {
  grid-column: 1;
  width: fit-content;
}

.balance-withdraw {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-actions a,
.primary-btn {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 800;
  cursor: pointer;
  transition: .2s ease;
}

.account-actions button {
  width: 100%;
  min-height: 72px;
  border: 2px solid #fecaca;
  border-radius: 14px;
  background: #fff;
  color: var(--danger);
  font-weight: 800;
  cursor: pointer;
  transition: .2s ease;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.account-actions a {
  gap: 10px;
  min-height: 74px;
  display: grid;
  justify-items: center;
  align-content: center;
  align-items: center;
  padding: 10px;
  border-color: rgba(233, 213, 255, .95);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(76, 29, 149, .08);
  text-align: center;
  font-size: .95rem;
  line-height: 1.2;
}

.account-actions a img {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 9px;
}

.account-actions a span,
.account-actions button {
  overflow-wrap: anywhere;
}

.account-actions form {
  margin: 0;
}

.auth-panel {
  min-height: 70vh;
  display: grid;
  place-items: center;
  align-content: center;
}

.auth-panel h1 {
  color: #ef4444;
}

.form-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
}

.form-card label,
.form-card p {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--muted);
}

.form-card input,
.form-card textarea,
.form-card select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.form-error {
  color: var(--danger) !important;
}

.text-link {
  text-align: center;
  color: var(--primary-dark);
  font-weight: 700;
}

.list-card {
  padding: 14px;
}

.history-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.history-row:last-child {
  border-bottom: 0;
}

.chat-page {
  position: relative;
  width: min(720px, 100%);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  background: #f8fbff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 16px;
  border-bottom: 1px solid #e0e7ff;
  background: rgba(255, 255, 255, .92);
  color: #172554;
}

.support-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2ff;
  color: #4f46e5;
  box-shadow: inset 0 0 0 1px #c7d2fe;
}

.support-avatar svg {
  width: 25px;
  height: 25px;
}

.support-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.support-heading {
  flex: 1;
  min-width: 0;
}

.support-heading h1 {
  margin: 0;
}

.support-heading h1 {
  font-size: 1.16rem;
  line-height: 1.15;
  color: #172554;
}

.support-heading span {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
}

.support-heading span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .14);
}

.support-meta {
  min-width: 48px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: .78rem;
  font-weight: 800;
}

.chat-log {
  height: clamp(420px, calc(100vh - 390px), 650px);
  min-height: 360px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  background:
    linear-gradient(rgba(241, 245, 249, .68) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 245, 249, .62) 1px, transparent 1px),
    #f8fbff;
  background-size: 28px 28px;
  scroll-behavior: smooth;
}

.chat-log::before,
.chat-log::after {
  content: "";
  position: sticky;
  z-index: 1;
  display: block;
  height: 16px;
  pointer-events: none;
}

.chat-log::before {
  top: 0;
  margin: -16px 0 0;
  background: linear-gradient(180deg, #f8fbff, rgba(248, 251, 255, 0));
}

.chat-log::after {
  bottom: 0;
  margin: 0 0 -16px;
  background: linear-gradient(0deg, #f8fbff, rgba(248, 251, 255, 0));
}

.chat-msg {
  max-width: 74%;
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.chat-msg.user {
  align-self: flex-end;
  color: #fff;
}

.chat-msg.staff {
  align-self: flex-start;
}

.chat-bubble {
  display: grid;
  gap: 5px;
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.chat-msg.user .chat-bubble {
  border-color: transparent;
  border-bottom-right-radius: 6px;
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 12px 24px rgba(79, 70, 229, .18);
}

.chat-msg.staff .chat-bubble {
  border-bottom-left-radius: 6px;
}

.chat-bubble span {
  line-height: 1.5;
  word-break: break-word;
  font-size: .98rem;
}

.chat-image {
  width: min(260px, 62vw);
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .28);
}

.chat-msg small {
  opacity: .75;
  font-size: .78rem;
}

.chat-empty {
  margin: auto;
  padding: 12px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  color: #64748b;
  background: rgba(255, 255, 255, .78);
  text-align: center;
}

.new-message-notice {
  position: absolute;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(239, 68, 68, .28);
  cursor: pointer;
}

.new-message-notice[hidden] {
  display: none;
}

.chat-form {
  display: grid;
  grid-template-columns: 56px 1fr 74px;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e0e7ff;
  background: #fff;
}

.chat-image-btn {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 800;
  cursor: pointer;
}

.chat-image-btn input {
  display: none;
}

.chat-form input {
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  color: #1e293b;
  outline: none;
  background: #f8fafc;
}

.chat-form input:focus {
  border-color: #4f46e5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .11);
}

.chat-form button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: #22c55e;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(34, 197, 94, .18);
  transition: .2s ease;
}

.chat-form button:hover {
  transform: translateY(-1px);
  filter: brightness(.98);
}

.toast-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .55);
  padding: 24px;
}

.toast-modal-card {
  width: min(360px, 100%);
  padding: 22px 24px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
}

.toast-modal-card p {
  margin: 0 0 16px;
  color: #1e293b;
  line-height: 1.55;
}

.toast-modal-card .primary-btn {
  width: 100%;
}

.inbox-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.inbox-row.unread strong {
  color: var(--primary-dark);
}

.inbox-dot {
  position: absolute;
  right: -2px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.inbox-badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: .72rem;
  text-align: center;
}

.inbox-detail {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.inbox-detail h1 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 1.2rem;
}

.inbox-meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .82rem;
}

.inbox-body {
  line-height: 1.7;
  color: #1e293b;
  white-space: pre-wrap;
}

.inbox-attachment {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary-dark);
  color: #fff;
  font-weight: 700;
}

.announcement-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .55);
  padding: 24px;
}

.announcement-modal-card {
  width: min(420px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
}

.announcement-modal-card h2 {
  margin: 0 0 12px;
  text-align: center;
  color: var(--primary-dark);
}

.announcement-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}

.announcement-modal-item {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.announcement-modal-item:last-child {
  border-bottom: 0;
}

.announcement-modal-item h3 {
  margin: 0 0 6px;
  color: #1e293b;
  font-size: 1rem;
}

.announcement-modal-item p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  white-space: pre-wrap;
}

.announcement-modal-card .primary-btn {
  width: 100%;
}

.empty {
  color: var(--muted);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 560px);
  }

  .topbar {
    justify-content: center;
    min-height: 66px;
  }

  .back-btn {
    min-height: 38px;
    padding: 0 10px;
    font-size: .82rem;
  }

  .bottom-nav {
    width: calc(100% - 14px);
    gap: 5px;
    padding: 8px;
    border-radius: 20px;
  }

  .bottom-nav a {
    min-height: 64px;
    flex: 1;
    flex-direction: column;
    text-align: center;
    padding: 6px 4px;
    font-size: .78rem;
    gap: 4px;
  }

  .bottom-nav a > span:not(.nav-badge) {
    display: block;
    width: 100%;
    text-align: center;
  }

  .hero {
    min-height: 300px;
    border-radius: 18px;
    box-shadow: 6px 7px 0 #ec4899;
  }

  .article-row,
  .profile-detail {
    grid-template-columns: 1fr;
  }

  .account-hero {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
  }

  .account-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-actions a,
  .account-actions button {
    min-height: 68px;
    font-size: .9rem;
  }

  .history-row {
    grid-template-columns: 1fr;
  }

  .chat-page {
    border-radius: 18px;
  }

  .chat-header {
    min-height: 68px;
    padding: 12px;
  }

  .support-avatar {
    width: 42px;
    height: 42px;
  }

  .chat-log {
    height: clamp(320px, calc(100vh - 380px), 560px);
    min-height: 0;
    padding: 12px;
  }

  .chat-msg {
    max-width: 82%;
  }

  .chat-form {
    grid-template-columns: 50px 1fr 68px;
    gap: 8px;
    padding: 10px;
  }

  .chat-form input,
  .chat-form button,
  .chat-image-btn {
    min-height: 44px;
    border-radius: 13px;
  }
}

body.support-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #f8fbff;
}

body.support-page .app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

body.support-page .topbar {
  display: none;
}

body.support-page .app-shell {
  padding-bottom: 96px;
}

body.support-page main {
  flex: 1;
  min-height: 0;
  display: flex;
}

body.support-page .chat-page {
  flex: 1;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: #f8fbff;
}

body.support-page .chat-header {
  flex: 0 0 auto;
}

body.support-page .chat-log {
  flex: 1;
  height: auto;
  min-height: 0;
}

body.support-page .chat-log::before,
body.support-page .chat-log::after {
  display: none;
}

body.support-page .chat-form {
  flex: 0 0 auto;
}

.chat-back-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #e0e7ff;
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  font-size: 1.4rem;
  line-height: 1;
  text-decoration: none;
}

.chat-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 12px 0;
  padding: 8px 10px;
  border: 1px dashed #94a3b8;
  border-radius: 12px;
  background: rgba(238, 242, 255, .6);
}

.chat-image-preview img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}

.chat-image-preview span {
  flex: 1;
  font-size: .82rem;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-image-preview button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.chat-image-preview[hidden] {
  display: none;
}

.read-state {
  display: block;
  margin-top: 2px;
  font-size: .72rem;
  font-weight: 700;
}

.read-state.read-ok {
  color: #d1fae5;
}

.read-state.read-wait {
  color: #fef3c7;
}

.chat-msg.staff .read-state.read-ok {
  color: #047857;
}

.chat-msg.staff .read-state.read-wait {
  color: #b45309;
}

.invite-card {
  width: min(720px, 100%);
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e9d5ff;
  border-radius: 18px;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 12px 30px rgba(124, 58, 237, .08);
}

.invite-label {
  flex: 0 0 auto;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: .9rem;
}

.invite-card code {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f5f3ff;
  color: #312e81;
  font-size: .82rem;
  word-break: break-all;
}

.invite-copy-btn {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-dark);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .55);
  padding: 24px;
}

.auth-modal-card {
  width: min(360px, 100%);
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
}

.auth-modal-card h2 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 1.2rem;
}

.auth-modal-card p {
  margin: 0 0 18px;
  color: #475569;
}

.auth-modal-card .primary-btn {
  width: 100%;
}

@media (max-width: 760px) {
  .invite-card {
    flex-wrap: wrap;
    gap: 8px;
  }

  .invite-card code {
    flex-basis: 100%;
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
