:root {
  --canvas: #fff7fa;
  --surface: #ffffff;
  --surface-soft: #fff0f5;
  --ink: #382a31;
  --muted: #806e77;
  --line: #efd8e2;
  --coral: #ed5f97;
  --coral-dark: #d5427d;
  --teal: #aa426b;
  --teal-soft: #fde3ed;
  --gold: #ad7a2d;
  --danger: #bf3d5d;
  --success: #277a50;
  --shadow: 0 16px 40px rgba(111, 49, 75, .12);
  --sidebar: 232px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar);
  padding: 25px 18px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 247, 250, .96);
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--coral);
  color: white;
  display: grid;
  place-items: center;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-copy strong { display: block; font-size: 16px; line-height: 1.1; }
.brand-copy small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; letter-spacing: 1.8px; }
.side-label { color: #999d9a; font-size: 11px; font-weight: 600; padding: 13px 11px 7px; }
.side-nav { display: grid; gap: 5px; }
.side-link {
  min-height: 42px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5f6461;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  transition: .18s ease;
}
.side-link svg { width: 18px; height: 18px; stroke-width: 1.8; }
.side-link:hover { background: #fdeaf1; color: var(--ink); }
.side-link.active { background: var(--coral); color: white; }
.side-link.admin-link.active { background: var(--teal); }
.sidebar-spacer { flex: 1; }
.points-pill {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #ead6dc;
  background: #fff8f3;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.points-pill svg { width: 17px; color: var(--gold); }
.points-pill span { display: block; font-size: 11px; color: var(--muted); }
.points-pill strong { font-size: 15px; }
.side-user {
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 15px 4px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--teal-soft); }
.avatar-fallback { display: grid; place-items: center; background: var(--teal); color: white; font-weight: 700; }
.side-user-copy { min-width: 0; flex: 1; }
.side-user-copy strong, .side-user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-copy strong { font-size: 13px; }
.side-user-copy span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.side-user > svg { width: 16px; color: var(--muted); }

.main { min-height: 100vh; margin-left: var(--sidebar); }
.content { width: min(1380px, calc(100% - 64px)); margin: 0 auto; padding: 30px 0 72px; }
.topbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-title { margin: 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; font-weight: 650; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-box { position: relative; width: min(330px, 30vw); }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--muted); }
.search-box input {
  width: 100%;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px 0 41px;
  background: var(--surface);
  outline: 0;
}
.search-box input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(237,95,151,.12); }
.icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: var(--surface-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.primary-btn, .secondary-btn, .danger-btn, .text-btn {
  min-height: 42px;
  border-radius: 7px;
  padding: 0 17px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
.primary-btn { background: var(--coral); color: white; }
.primary-btn:hover { background: var(--coral-dark); }
.primary-btn.coral { background: var(--coral); }
.primary-btn.coral:hover { background: var(--coral-dark); }
.secondary-btn { background: var(--surface); border-color: var(--line); color: var(--ink); }
.secondary-btn:hover { background: var(--surface-soft); }
.danger-btn { background: #fff4f3; color: var(--danger); border-color: #f1cfcb; }
.text-btn { background: transparent; color: var(--teal); padding-inline: 6px; }
.primary-btn svg, .secondary-btn svg, .danger-btn svg, .text-btn svg { width: 16px; height: 16px; }
.wide-btn { width: 100%; }
.small-btn { min-height: 32px; padding: 0 11px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.spotlight {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: 8px;
  background: #3b2932;
  color: white;
  margin-bottom: 27px;
}
.spotlight img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; opacity: .72; }
.spotlight::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(48,25,37,.92) 0%, rgba(66,34,49,.58) 43%, rgba(49,26,38,.08) 76%); }
.spotlight-content { position: relative; z-index: 2; width: min(520px, 62%); padding: 46px 50px; }
.eyebrow { margin: 0 0 13px; text-transform: uppercase; font-size: 11px; letter-spacing: 1.6px; font-weight: 700; color: #ffc1d8; }
.spotlight h2 { margin: 0; font-size: clamp(28px, 4vw, 45px); line-height: 1.1; font-weight: 600; }
.spotlight p { margin: 15px 0 23px; color: rgba(255,255,255,.78); line-height: 1.75; font-size: 14px; }
.light-btn { background: white; color: var(--ink); border: 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-title { margin: 0; font-size: 20px; font-weight: 650; }
.section-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.segments { display: flex; gap: 4px; background: #f9e8ef; padding: 4px; border-radius: 7px; overflow-x: auto; }
.segment { height: 33px; border: 0; background: transparent; border-radius: 5px; padding: 0 14px; color: var(--muted); white-space: nowrap; font-size: 13px; }
.segment.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 600; }
.character-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.character-card { min-width: 0; background: var(--surface); border: 1px solid #f0dce4; border-radius: 7px; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.character-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.character-image { position: relative; aspect-ratio: 4 / 4.65; overflow: hidden; background: #ddd; cursor: pointer; }
.character-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.character-card:hover .character-image img { transform: scale(1.035); }
.image-shade { position: absolute; inset: auto 0 0; height: 38%; background: linear-gradient(transparent, rgba(0,0,0,.68)); }
.popularity { position: absolute; left: 12px; bottom: 11px; display: flex; align-items: center; gap: 5px; color: white; font-size: 11px; }
.popularity svg { width: 14px; height: 14px; fill: var(--coral); color: var(--coral); }
.card-favorite { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; display: grid; place-items: center; color: white; background: rgba(20,22,21,.38); backdrop-filter: blur(8px); }
.card-favorite svg { width: 16px; }
.character-body { padding: 14px 14px 15px; }
.character-title-line { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.character-title { margin: 0; font-size: 16px; font-weight: 650; }
.category-tag { padding: 3px 7px; border-radius: 4px; background: var(--teal-soft); color: var(--teal); font-size: 10px; white-space: nowrap; }
.character-tagline { min-height: 40px; margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f6e8ed; padding-top: 12px; }
.tags { display: flex; gap: 5px; overflow: hidden; }
.tag { font-size: 10px; color: #777b78; white-space: nowrap; }
.chat-arrow { width: 31px; height: 31px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: white; flex: 0 0 auto; }
.chat-arrow svg { width: 14px; height: 14px; }
.empty-state { min-height: 320px; display: grid; place-items: center; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 7px; }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 12px; }

.pricing-intro { max-width: 650px; margin: 18px auto 36px; text-align: center; }
.pricing-intro .page-title { font-size: clamp(30px, 4vw, 46px); }
.pricing-intro p { color: var(--muted); line-height: 1.8; }
.billing-note { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--teal); font-size: 13px; font-weight: 600; }
.billing-note svg { width: 16px; }
.product-tabs { width: max-content; max-width: 100%; margin: -16px auto 28px; }
.product-tabs .segment { min-width: 132px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.product-tabs .segment svg { width: 15px; height: 15px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1040px; margin: 0 auto; align-items: stretch; }
.plan-card { position: relative; padding: 27px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 470px; }
.plan-card.featured { background: #3a2932; color: white; border-color: #3a2932; transform: translateY(-8px); box-shadow: var(--shadow); }
.plan-card.point-card { min-height: 430px; }
.plan-badge { position: absolute; top: 17px; right: 17px; background: var(--coral); color: white; border-radius: 4px; padding: 5px 8px; font-size: 10px; font-weight: 700; }
.plan-days { color: var(--teal); font-size: 12px; font-weight: 700; }
.featured .plan-days { color: #8cd0c8; }
.plan-name { margin: 9px 0 3px; font-size: 22px; }
.plan-desc { min-height: 42px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.featured .plan-desc { color: #aeb6b2; }
.plan-price { margin: 23px 0; font-size: 42px; font-weight: 650; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.featured .plan-price small { color: #aeb6b2; }
.points-value { background: var(--surface-soft); border-radius: 6px; padding: 14px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.featured .points-value { background: rgba(255,255,255,.08); }
.points-value span { color: var(--muted); font-size: 11px; }
.featured .points-value span { color: #aeb6b2; }
.points-value strong { color: var(--gold); font-size: 19px; }
.plan-benefits { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; flex: 1; }
.plan-benefits li { display: flex; gap: 9px; color: #5e6460; font-size: 12px; }
.featured .plan-benefits li { color: #d8dcda; }
.plan-benefits svg { width: 16px; height: 16px; color: var(--teal); flex: 0 0 16px; }
.featured .plan-benefits svg { color: #8cd0c8; }

.account-grid { display: grid; grid-template-columns: 1fr 1.65fr; gap: 22px; }
.profile-panel { background: #3a2932; color: white; padding: 28px; border-radius: 8px; min-height: 280px; }
.profile-head { display: flex; align-items: center; gap: 15px; }
.profile-avatar { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); font-size: 22px; font-weight: 700; }
.profile-head h2 { margin: 0 0 5px; font-size: 20px; }
.profile-head p { margin: 0; color: #aab2ae; font-size: 12px; }
.balance-block { margin: 30px 0 24px; }
.balance-block span { color: #aab2ae; font-size: 12px; }
.balance-value { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; }
.balance-value strong { font-size: 42px; line-height: 1; }
.balance-value small { color: #cbd0cd; }
.membership-row { display: flex; align-items: center; justify-content: space-between; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.13); }
.membership-row span { font-size: 12px; color: #aab2ae; }
.member-chip { padding: 5px 8px; border-radius: 4px; background: rgba(232,93,66,.18); color: #ff9d88; font-size: 11px; }
.claim-panel { margin-top: 16px; padding: 18px; border-radius: 7px; background: var(--teal-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.claim-panel strong, .claim-panel span { display: block; }
.claim-panel span { font-size: 12px; color: var(--teal); margin-top: 3px; }
.data-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 20px; }
.tab { height: 54px; border: 0; background: transparent; color: var(--muted); padding: 0 15px; position: relative; }
.tab.active { color: var(--ink); font-weight: 650; }
.tab.active::after { content: ''; position: absolute; height: 2px; inset: auto 13px -1px; background: var(--coral); }
.list-table { width: 100%; border-collapse: collapse; }
.list-table th { color: #8a8e8b; font-size: 11px; font-weight: 600; text-align: left; background: #fafaf8; }
.list-table th, .list-table td { padding: 14px 18px; border-bottom: 1px solid #ecebe7; }
.list-table td { font-size: 12px; }
.list-table tr:last-child td { border-bottom: 0; }
.amount-positive { color: var(--success); font-weight: 650; }
.amount-negative { color: var(--coral-dark); font-weight: 650; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 4px; font-size: 10px; font-weight: 650; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-paid, .status-active, .status-success { color: var(--success); background: #e8f4ed; }
.status-pending { color: #a26d12; background: #fff3d9; }
.status-disabled, .status-cancelled, .status-failed { color: var(--danger); background: #fbe9e7; }

.chat-layout { height: 100vh; display: grid; grid-template-columns: 285px minmax(0,1fr); margin-left: var(--sidebar); background: var(--surface); }
.conversation-list { border-right: 1px solid var(--line); background: #fff2f6; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.conversation-list-head { height: 72px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.conversation-list-head strong { font-size: 15px; }
.conversation-head-actions { display: flex; gap: 7px; }
.conversation-head-actions .icon-btn { width: 34px; height: 34px; flex-basis: 34px; }
.conversation-scroll { overflow-y: auto; padding: 8px; }
.conversation-item { width: 100%; border: 0; background: transparent; padding: 11px; display: flex; gap: 10px; text-align: left; border-radius: 6px; }
.conversation-item:hover, .conversation-item.active { background: white; box-shadow: 0 3px 12px rgba(111,49,75,.06); }
.conversation-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.conversation-copy { min-width: 0; }
.conversation-copy strong, .conversation-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { font-size: 12px; margin-bottom: 5px; }
.conversation-copy span { color: var(--muted); font-size: 10px; }
.group-avatar-stack { position: relative; width: 118px; height: 40px; flex: 0 0 118px; display: flex; align-items: center; }
.group-avatar-stack img { position: relative; width: 36px; height: 36px; margin-left: -14px; border: 2px solid white; border-radius: 50%; object-fit: cover; background: var(--teal-soft); }
.group-avatar-stack img:first-child { margin-left: 0; }
.group-avatar-stack img:nth-child(1) { z-index: 5; }.group-avatar-stack img:nth-child(2) { z-index: 4; }.group-avatar-stack img:nth-child(3) { z-index: 3; }.group-avatar-stack img:nth-child(4) { z-index: 2; }
.group-avatar-stack.compact { width: 82px; height: 34px; flex-basis: 82px; }
.group-avatar-stack.compact img { width: 30px; height: 30px; margin-left: -12px; }
.group-avatar-more { z-index: 6; width: 24px; height: 24px; margin-left: -9px; border: 2px solid white; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font-size: 8px; font-weight: 700; }
.conversation-item .group-avatar-stack img { width: 30px; height: 30px; }
.recent-conversation { display: flex; align-items: center; gap: 10px; }
.admin-table td .recent-conversation .group-avatar-stack { display: flex; }
.admin-table td .recent-conversation .group-avatar-more { display: grid; }
.recent-conversation > span:last-child { display: grid; gap: 3px; }
.recent-conversation small { color: var(--muted); font-size: 10px; }
.recent-message { max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.chat-panel { min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.chat-head { height: 72px; flex: 0 0 72px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.chat-head-actions { display: flex; align-items: center; gap: 11px; }
.group-settings-btn { width: 36px; height: 36px; flex-basis: 36px; }
.chat-person { display: flex; align-items: center; gap: 11px; }
.chat-person img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-person strong, .chat-person span { display: block; }
.chat-person strong { font-size: 14px; }
.chat-person span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.chat-person .group-avatar-stack { display: flex; margin-top: 0; }
.chat-person .group-avatar-stack img { width: 36px; height: 36px; }
.chat-person .group-avatar-more { display: grid; color: white; margin-top: 0; }
.chat-balance { display: flex; align-items: center; gap: 7px; color: var(--gold); font-size: 12px; font-weight: 650; }
.chat-balance svg { width: 16px; }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 32px max(28px, calc((100% - 760px)/2)); background: #fffafd; }
.message { display: flex; gap: 10px; margin: 0 0 22px; align-items: flex-start; animation: messageIn .22s ease-out; }
.message.user { justify-content: flex-end; }
.message-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 32px; }
.message-bubble { max-width: min(680px, 78%); padding: 13px 15px; border-radius: 4px 14px 14px 14px; background: white; border: 1px solid #f0dce4; line-height: 1.8; font-size: 13px; white-space: pre-wrap; }
.message.user .message-bubble { order: 1; background: var(--coral); color: white; border-color: var(--coral); border-radius: 14px 4px 14px 14px; }
.message.user .message-avatar { order: 2; }
.message-author { display: block; margin-bottom: 4px; color: var(--coral-dark); font-size: 10px; font-weight: 700; line-height: 1.3; }
.group-typing-avatar { background: var(--teal-soft); color: var(--coral-dark); }
.group-typing-avatar svg { width: 16px; height: 16px; }
.group-welcome { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 32px; }
.group-welcome .group-avatar-stack { margin-bottom: 18px; }
.group-welcome strong { color: var(--ink); font-size: 17px; margin-bottom: 8px; }
.group-welcome > span:last-child { max-width: 480px; font-size: 12px; line-height: 1.8; }
.typing { display: inline-flex; align-items: center; gap: 4px; min-width: 54px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity:.25; transform:translateY(0) } 40% { opacity:1; transform:translateY(-3px) } }
@keyframes messageIn { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: translateY(0) } }
.composer-wrap { padding: 16px max(24px, calc((100% - 790px)/2)) 20px; border-top: 1px solid var(--line); background: white; }
.composer { display: flex; align-items: flex-end; border: 1px solid #e4cbd5; border-radius: 8px; padding: 9px 9px 9px 14px; box-shadow: 0 8px 22px rgba(111,49,75,.06); }
.composer:focus-within { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(237,95,151,.1); }
.composer textarea { flex: 1; min-width: 0; min-height: 37px; max-height: 130px; resize: none; border: 0; outline: 0; padding: 9px 8px 5px 0; background: transparent; line-height: 1.5; }
.send-btn { width: 39px; height: 39px; border: 0; border-radius: 7px; background: var(--coral); color: white; display: grid; place-items: center; flex: 0 0 39px; }
.send-btn svg { width: 17px; }
.composer-meta { margin: 7px 2px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: #999d9a; font-size: 10px; }

.admin-shell { min-height: 100vh; background: #f4f5f3; }
.admin-sidebar { background: #17201e; color: white; border: 0; }
.admin-sidebar .brand-copy small, .admin-sidebar .side-label { color: #71807c; }
.admin-sidebar .side-link { color: #a8b3af; }
.admin-sidebar .side-link:hover { background: #24302d; color: white; }
.admin-sidebar .side-link.active { background: var(--teal); }
.admin-sidebar .side-user { border-color: #2c3935; color: white; }
.admin-sidebar .side-user-copy span { color: #85938e; }
.admin-main { margin-left: var(--sidebar); padding: 29px 34px 60px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-topbar h1 { margin: 0; font-size: 25px; }
.admin-topbar p { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.admin-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: white; border: 1px solid #dfe2df; border-radius: 7px; padding: 18px; min-height: 118px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.stat-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--teal-soft); color: var(--teal); }
.stat-icon.coral { background: #f8e2dd; color: var(--coral); }.stat-icon.gold { background: #f6ecd6; color: var(--gold); }
.stat-icon svg { width: 16px; }
.stat-value { margin-top: 14px; font-size: 27px; font-weight: 650; }
.admin-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 18px; }
.admin-panel { background: white; border: 1px solid #dfe2df; border-radius: 7px; }
.panel-head { min-height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e6e8e5; }
.panel-head h2 { margin: 0; font-size: 14px; }
.panel-body { padding: 18px; }
.chart { height: 240px; display: flex; align-items: end; gap: 14px; padding-top: 24px; border-bottom: 1px solid var(--line); }
.chart-day { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.chart-bars { height: 188px; width: 100%; display: flex; align-items: end; justify-content: center; gap: 4px; }
.bar { width: min(17px, 36%); min-height: 3px; border-radius: 3px 3px 0 0; background: var(--teal); }
.bar.secondary { background: #f0a08f; }
.chart-label { color: var(--muted); font-size: 9px; white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; font-size: 10px; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 6px; }.legend-item i { width: 7px; height: 7px; background: var(--teal); border-radius: 2px; }.legend-item i.coral { background: #f0a08f; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #e9ebe8; white-space: nowrap; font-size: 11px; }
.admin-table th { background: #f8f9f7; color: #79807c; font-weight: 600; }
.admin-table tbody tr:hover { background: #fcfcfa; }
.admin-table td strong, .admin-table td span { display: block; }
.admin-table td span { color: var(--muted); margin-top: 3px; }
.table-actions { display: flex; gap: 6px; }
.table-icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: white; border-radius: 5px; display: grid; place-items: center; color: #555b57; }
.table-icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.table-icon-btn svg { width: 14px; }
.filter-row { display: flex; gap: 10px; align-items: center; }
.compact-input, .compact-select { height: 36px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 0 11px; outline: 0; font-size: 12px; }
.compact-input:focus, .compact-select:focus { border-color: var(--teal); }
.model-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.field { min-width: 0; }
.field.full { grid-column: 1/-1; }
.field label { display: block; font-size: 11px; color: #676d69; font-weight: 600; margin-bottom: 7px; }
.field input, .field textarea, .field select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 10px 12px; outline: 0; }
.field textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(36,122,115,.09); }
.form-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.switch-row { min-height: 42px; display: flex; align-items: center; gap: 10px; }
.switch { position: relative; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 20px; background: #c7cbc8; transition: .2s; }
.switch-track::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; }
.switch input:checked + .switch-track { background: var(--teal); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.script-list { display: grid; gap: 12px; }
.script-item { border: 1px solid var(--line); border-radius: 6px; padding: 15px; display: grid; grid-template-columns: 1fr auto; gap: 13px; }
.script-item h3 { margin: 0 0 5px; font-size: 13px; }
.script-item code { color: var(--teal); font-size: 10px; }
.script-item p { margin: 8px 0 0; font-family: ui-monospace, monospace; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 700px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(14,17,16,.58); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(5px); animation: fade .16s ease; }
.modal { width: min(440px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.modal.wide { width: min(650px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 21px 23px 12px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-close { width: 35px; height: 35px; border: 0; border-radius: 50%; background: var(--surface-soft); display: grid; place-items: center; }
.modal-close svg { width: 17px; }
.modal-body { padding: 10px 23px 24px; }
.auth-brand { margin: 5px 0 23px; }
.auth-brand p { color: var(--muted); line-height: 1.7; font-size: 13px; }
.form-stack { display: grid; gap: 14px; }
.form-error { display: none; padding: 10px 12px; border-radius: 5px; background: #fbe9e7; color: var(--danger); font-size: 12px; }
.auth-switch { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12px; }
.auth-switch button { border: 0; background: transparent; color: var(--teal); padding: 3px; font-weight: 600; }
.payment-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 13px 0 22px; }
.payment-option { min-height: 66px; border: 1px solid var(--line); border-radius: 6px; background: white; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: 11px; }
.payment-option svg { width: 20px; }
.payment-option.active { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 0 2px rgba(36,122,115,.1); }
.order-summary { background: var(--surface-soft); border-radius: 6px; padding: 14px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.order-summary span { color: var(--muted); font-size: 12px; }.order-summary strong { font-size: 19px; }
.settings-block { margin-bottom: 22px; }
.settings-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--ink); font-size: 12px; font-weight: 700; }
.settings-label small { color: var(--muted); font-size: 10px; font-weight: 500; }
.group-mode-segments, .reply-count-segments { width: 100%; }
.group-mode-segments .segment, .reply-count-segments .segment { flex: 1; }
.member-picker { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.member-option { position: relative; min-width: 0; min-height: 94px; padding: 11px 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.member-option input { position: absolute; opacity: 0; pointer-events: none; }
.member-option img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.member-option span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.member-option > svg { display: none; position: absolute; top: 7px; right: 7px; width: 14px; height: 14px; color: var(--coral); }
.member-option.selected { border-color: var(--coral); background: #fff3f7; box-shadow: 0 0 0 2px rgba(237,95,151,.08); }
.member-option.selected > svg { display: block; }
.group-setting-summary { min-height: 58px; margin: 4px 0 20px; padding: 12px 14px; border-radius: 7px; background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; gap: 11px; }
.group-setting-summary > svg { width: 19px; flex: 0 0 19px; }
.group-setting-summary span, .group-setting-summary small { display: block; }
.group-setting-summary span { font-size: 11px; font-weight: 650; }
.group-setting-summary small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 500; }
#toast-root { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 7px; background: #1d211f; color: white; box-shadow: var(--shadow); display: flex; align-items: center; gap: 9px; font-size: 12px; animation: toastIn .2s ease; }
.toast.error { background: #9f3030; }.toast.success { background: var(--teal); }
.toast svg { width: 16px; flex: 0 0 16px; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) } }
.skeleton { background: linear-gradient(90deg,#e7e6e1 25%,#f1f0ec 37%,#e7e6e1 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }
.loading-page { height: 60vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 24px; height: 24px; border: 2px solid #d6d6d0; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.mobile-topbar, .mobile-nav { display: none; }

@media (max-width: 1180px) {
  .character-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --mobile-header: 58px; --mobile-nav: 65px; }
  .sidebar { display: none; }
  .main, .admin-main { margin-left: 0; }
  .content { width: calc(100% - 28px); padding: calc(var(--mobile-header) + 18px) 0 calc(var(--mobile-nav) + 28px); }
  .mobile-topbar { display: flex; position: fixed; z-index: 50; inset: 0 0 auto; height: var(--mobile-header); background: rgba(255,247,250,.97); border-bottom: 1px solid var(--line); align-items: center; justify-content: space-between; padding: 0 14px; }
  .mobile-topbar .brand { padding: 0; }.mobile-topbar .brand-mark { width: 31px; height: 31px; }.mobile-topbar .brand-copy small { display: none; }
  .mobile-nav { display: grid; position: fixed; z-index: 50; inset: auto 0 0; height: calc(var(--mobile-nav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); grid-template-columns: repeat(4,1fr); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); }
  .user-mobile-nav { grid-template-columns: repeat(5,1fr); }
  .mobile-link { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; }
  .mobile-link svg { width: 19px; height: 19px; }.mobile-link.active { color: var(--coral); }
  .topbar { align-items: flex-start; margin-bottom: 17px; }.page-title { font-size: 25px; }.page-subtitle { font-size: 12px; }
  .recent-topbar { flex-wrap: wrap; }.recent-topbar .top-actions { flex: 0 0 100%; justify-content: flex-start; }
  .top-actions { flex: 1; justify-content: flex-end; }.search-box { width: 42px; }.search-box input { padding: 0; color: transparent; }.search-box input::placeholder { color: transparent; }.search-box svg { left: 12px; }
  .spotlight { min-height: 270px; }.spotlight img { object-position: 62% 18%; }.spotlight::after { background: linear-gradient(90deg,rgba(48,25,37,.9),rgba(66,34,49,.48)); }.spotlight-content { width: 78%; padding: 34px 24px; }.spotlight h2 { font-size: 30px; }.spotlight p { line-height: 1.6; }
  .section-head { display: block; }.segments { margin-top: 13px; }
  .character-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }.character-body { padding: 11px; }.character-title { font-size: 14px; }.character-tagline { font-size: 11px; }.category-tag { display: none; }
  .plan-grid { grid-template-columns: 1fr; max-width: 470px; }.plan-card { min-height: auto; }.plan-card.featured { transform: none; order: -1; }.pricing-intro { margin-top: 4px; }.pricing-intro .page-title { font-size: 31px; }
  .product-tabs { margin-top: -8px; }.plan-card.point-card { min-height: auto; }
  .account-grid { grid-template-columns: 1fr; }.data-panel { overflow-x: auto; }.list-table { min-width: 600px; }
  .chat-layout { margin-left: 0; grid-template-columns: 1fr; height: 100vh; height: 100dvh; padding-top: var(--mobile-header); padding-bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom)); overflow: hidden; }.conversation-list { display: none; }.chat-panel { height: 100%; min-height: 0; }.chat-head { height: 58px; flex-basis: 58px; padding: 0 14px; }.messages { padding: 22px 14px; }.message-bubble { max-width: 82%; }.composer-wrap { flex: 0 0 auto; padding: 11px 12px; }
  body:has(#chat-input:focus) .mobile-nav { display: none; }
  body:has(#chat-input:focus) .chat-layout { padding-bottom: 0; }
  .admin-main { padding: calc(var(--mobile-header) + 18px) 14px 90px; }.admin-stats { grid-template-columns: 1fr 1fr; gap: 9px; }.stat-card { padding: 14px; min-height: 108px; }.stat-value { font-size: 22px; }.admin-topbar { align-items: flex-start; }.admin-topbar .top-actions { display: none; }.model-form { grid-template-columns: 1fr; }.field.full,.form-actions { grid-column: auto; }.admin-panel { overflow: hidden; }
  .member-picker { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 430px) {
  .spotlight { min-height: 246px; }.spotlight-content { width: 88%; padding: 28px 20px; }.spotlight p { font-size: 12px; margin: 11px 0 17px; }.spotlight h2 { font-size: 26px; }
  .character-image { aspect-ratio: 4/5; }.tags .tag:nth-child(n+3) { display:none; }
  .admin-stats { grid-template-columns: 1fr; }.stat-card { min-height: 95px; }.admin-main { padding-inline: 10px; }.admin-topbar h1 { font-size: 21px; }
  .payment-options { grid-template-columns: 1fr; }.payment-option { flex-direction: row; min-height: 48px; }
  .product-tabs { width: 100%; }.product-tabs .segment { min-width: 0; flex: 1; }
  .chat-head { gap: 8px; }.group-person { min-width: 0; gap: 7px; }.group-person .group-avatar-stack { width: 118px; flex-basis: 118px; }.group-person > span:last-child { min-width: 0; }.group-person > span:last-child strong, .group-person > span:last-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.chat-head-actions { gap: 7px; }.chat-balance { font-size: 10px; }
}
