:root {
  --paper: #fff3d7;
  --white: #fffdf9;
  --ink: #243145;
  --muted: #6e726d;
  --line: #e7dfd3;
  --jade: #27a996;
  --jade-soft: #daf8ef;
  --rose: #ff5f8f;
  --coral: #ff9b72;
  --gold: #ffc447;
  --lavender: #8c76ff;
  --shadow: 0 18px 48px rgba(29, 24, 16, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 95, 143, 0.18), transparent 26rem),
    radial-gradient(circle at 80% 0%, rgba(39, 169, 150, 0.2), transparent 24rem),
    #fff0b6;
  color: var(--ink);
  font-family:
    "Pretendard",
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  position: relative;
  padding-bottom: 92px;
}

.topbar {
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  width: 104px;
  height: 42px;
  border: 0;
  padding: 0;
  background: transparent;
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-wordmark {
  width: auto;
  min-width: 0;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fff8e8;
  background: var(--ink);
  font-weight: 950;
  line-height: 1;
}

.brand-text {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.top-tools,
.metric {
  display: flex;
  align-items: center;
}

.top-tools {
  gap: 8px;
}

.auth-chip {
  max-width: 92px;
  min-height: 32px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: #392700;
  background: #fee500;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric,
.icon-button {
  border: 0;
  background: transparent;
}

.metric {
  gap: 5px;
  height: 34px;
  padding: 0 2px;
}

.metric strong {
  min-width: 10px;
  font-size: 16px;
}

.coin {
  width: 20px;
  height: 20px;
  display: inline-block;
  border-radius: 50%;
  position: relative;
}

.coin-sun {
  border: 3px double #f29c21;
}

.coin-sun::after {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 2px solid #f29c21;
  content: "";
  position: absolute;
  inset: 4px;
}

.coin-orbit {
  border: 3px dotted var(--rose);
}

.coin-orbit::before {
  width: 6px;
  height: 6px;
  right: -3px;
  top: -3px;
  border-radius: 50%;
  background: var(--rose);
  content: "";
  position: absolute;
}

.icon-button {
  width: 30px;
  height: 34px;
  border-radius: 8px;
  position: relative;
}

.icon-button::before,
.icon-button::after {
  content: "";
  position: absolute;
}

.gift::before {
  inset: 9px 5px 5px;
  border: 3px solid var(--rose);
  border-radius: 3px;
}

.gift::after {
  left: 5px;
  right: 5px;
  top: 12px;
  height: 3px;
  background: var(--rose);
  box-shadow: 10px -5px 0 -1px var(--rose);
}

.help::before {
  inset: 4px;
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.help::after {
  content: "?";
  inset: 5px 0 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
}

.menu::before {
  left: 4px;
  right: 4px;
  top: 8px;
  height: 3px;
  border-radius: 4px;
  background: var(--ink);
  box-shadow: 0 8px 0 var(--ink), 0 16px 0 var(--ink);
}

.view {
  display: none;
  min-height: calc(100vh - 164px);
  background: var(--white);
}

.view.is-active {
  display: block;
}

.banner-carousel {
  height: 304px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.banner-slide {
  height: 100%;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 240ms ease;
}

.banner-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.banner-slide img,
.slim-poster::before {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.banner-slide img {
  filter: saturate(1.04);
}

.banner-slide::after {
  inset: 0;
  position: absolute;
  content: "";
  background: linear-gradient(90deg, rgba(255, 250, 241, 0.9), rgba(255, 250, 241, 0.42), transparent);
}

.banner-copy {
  width: 52%;
  position: absolute;
  z-index: 1;
  left: 22px;
  bottom: 42px;
}

.banner-copy-right {
  left: auto;
  right: 18px;
  text-align: right;
}

.banner-copy p,
.slim-poster p {
  margin: 0 0 7px;
  color: var(--jade);
  font-size: 13px;
  font-weight: 800;
}

.banner-copy h1,
.banner-copy h2 {
  margin: 0 0 16px;
  line-height: 1.08;
  font-size: 34px;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.banner-copy h2 {
  font-size: 28px;
}

.banner-button,
.product-copy footer button,
.primary-action {
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), #b44592);
  box-shadow: 0 10px 20px rgba(218, 87, 120, 0.24);
  font-weight: 800;
}

.banner-button {
  min-height: 40px;
  padding: 0 15px;
}

.carousel-dots {
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 7px;
  position: absolute;
  z-index: 2;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.72);
}

.carousel-dots button.is-active {
  width: 31px;
  background: #fff;
}

.filters,
.library-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters {
  padding: 16px 14px;
}

.filters button,
.library-filters button,
.choice-row button,
.answer-chips button,
.year-panel button,
.profile-strip button {
  min-height: 40px;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  color: #3c4540;
  background: #f3f2ee;
  font-weight: 800;
}

.filters button.is-active,
.library-filters button.is-active,
.choice-row button.is-active,
.year-panel button.is-active {
  color: #fff;
  background: var(--ink);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.product-card {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.product-card:nth-child(2n) {
  border-right: 0;
}

.product-card.is-hidden {
  display: none;
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: #efe7d9;
}

.product-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 240ms ease;
}

.product-image:hover img {
  transform: scale(1.03);
}

.product-image::after {
  inset: 0;
  position: absolute;
  content: "";
  background: linear-gradient(180deg, rgba(36, 49, 69, 0.02), rgba(36, 49, 69, 0.44));
}

.product-image span {
  left: 13px;
  right: 13px;
  bottom: 12px;
  z-index: 1;
  color: #fff;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 950;
  line-height: 1;
  position: absolute;
  text-align: left;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.38);
}

.product-copy {
  min-height: 128px;
  padding: 12px 10px 13px;
}

.login-panel h2,
.payment-panel h2,
.payment-result h2,
.product-copy h2,
.fortune-card h2,
.purpose-panel h2,
.timeline-panel h2 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.25;
}

.product-copy p,
.archive-list p {
  min-height: 40px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-copy footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.product-copy strong {
  color: var(--rose);
  font-size: 13px;
}

.product-copy footer button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.product-card-wide {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-right: 0;
}

.product-card-wide .product-copy {
  display: grid;
  align-content: center;
}

.home-story {
  padding: 28px 18px 44px;
  background: linear-gradient(180deg, #fffdf8, #fff4d7);
}

.home-story h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.home-story p,
.year-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.story-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
}

.story-points span {
  border: 1px solid #d8c8ac;
  border-radius: 999px;
  padding: 8px 11px;
  color: #5a4727;
  background: #fff8e8;
  font-size: 12px;
  font-weight: 800;
}

.view-title {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #fff;
}

.view-title.emerald {
  background: var(--jade);
}

.view-title.rose {
  background: var(--rose);
}

.view-title h1,
.chat-head h1,
.slim-poster h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}

.view-title button {
  width: 36px;
  height: 36px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 31px;
  line-height: 1;
}

.stack-form {
  display: grid;
  gap: 18px;
  padding: 24px 20px;
}

.stack-form label,
.fortune-card label {
  display: grid;
  gap: 9px;
  font-weight: 900;
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.primary-action {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 16px;
}

.slim-poster {
  height: 142px;
  position: relative;
  overflow: hidden;
  padding: 24px 20px;
  display: grid;
  align-content: center;
}

.slim-poster::before {
  inset: 0;
  position: absolute;
  content: "";
  z-index: 0;
  opacity: 0.72;
  filter: saturate(1.08);
}

.slim-poster::after {
  inset: 0;
  position: absolute;
  content: "";
  background: linear-gradient(90deg, rgba(255, 253, 248, 0.94), rgba(255, 253, 248, 0.36));
}

.slim-poster > * {
  position: relative;
  z-index: 1;
}

.fortune-poster::before {
  background: url("./assets/generated/banners/daily-flow.jpg") center / cover;
}

.wallet-poster::before,
.payment-poster::before {
  background: url("./assets/generated/banners/hero-lab.jpg") center / cover;
}

.calendar-poster::before {
  background: url("./assets/generated/banners/auspicious-date.jpg") center / cover;
}

.cycle-poster::before {
  background: url("./assets/generated/thumbnails/fortune-cycle.jpg") center / cover;
}

.year-poster::before {
  background: url("./assets/generated/thumbnails/year-wheel.jpg") center / cover;
}

.library-poster::before {
  background: url("./assets/generated/thumbnails/consult-chat.jpg") center / cover;
}

.profile-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: auto;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.profile-strip button {
  color: var(--jade);
  background: var(--jade-soft);
}

.purpose-panel,
.month-panel,
.fortune-card,
.timeline-panel,
.year-panel {
  margin: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.purpose-panel {
  padding: 18px 14px;
}

.purpose-panel h2 b {
  width: 27px;
  height: 27px;
  margin-right: 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--rose);
  font-size: 14px;
}

.choice-row,
.answer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice-row {
  padding-top: 12px;
}

.month-panel {
  padding: 18px 10px 14px;
}

.month-panel header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
}

.month-panel header h2 {
  margin: 0;
  text-align: center;
  font-size: 18px;
}

.month-panel header button,
.calendar-grid button {
  border: 0;
  background: transparent;
}

.month-panel header button {
  height: 42px;
  font-size: 28px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding-top: 12px;
  text-align: center;
}

.calendar-grid span,
.calendar-grid button {
  height: 38px;
  display: grid;
  place-items: center;
}

.calendar-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-grid button {
  border-radius: 50%;
  color: var(--ink);
}

.calendar-grid .muted {
  color: #b9b6af;
}

.calendar-grid .picked {
  color: #fff;
  background: var(--jade);
}

.calendar-action {
  width: calc(100% - 32px);
  margin: 0 16px 28px;
}

.fortune-card {
  padding: 18px 16px;
}

.fortune-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.fortune-card time {
  color: var(--muted);
  font-size: 12px;
}

.fortune-card h3 {
  margin: 20px 0 12px;
  font-size: 16px;
}

.answer-chips {
  margin-bottom: 20px;
}

.answer-chips button:last-child {
  color: var(--rose);
  background: #fff1f4;
}

.chat-head {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.chat-head h1 {
  font-size: 19px;
}

.chat-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-head button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  background: #f4efe5;
  font-weight: 800;
}

.chat-thread {
  min-height: calc(100vh - 314px);
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px 16px;
  background: linear-gradient(180deg, #fff, #faf5ec);
}

.date-pill {
  justify-self: center;
  margin: 0;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #f1ede6;
  font-size: 12px;
}

.message {
  max-width: 82%;
  border-radius: 18px;
  padding: 14px;
  line-height: 1.5;
  box-shadow: 0 8px 18px rgba(29, 24, 16, 0.08);
}

.message.assistant {
  background: #fff;
}

.message.user {
  justify-self: end;
  color: #fff;
  background: var(--jade);
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-compose button {
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--rose);
  font-size: 24px;
}

.library-filters {
  padding: 14px 16px;
}

.archive-list article {
  min-height: 92px;
  padding: 18px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, #fff4cd, #fff);
}

.archive-list h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  font-size: 18px;
}

.archive-list h2 b {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--gold);
  font-size: 12px;
}

.archive-list p {
  min-height: 0;
  margin: 0;
}

.login-panel,
.payment-panel,
.payment-result {
  margin: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.login-panel p,
.payment-panel p,
.payment-result p,
.plan-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-panel {
  display: grid;
  gap: 11px;
  background: linear-gradient(135deg, #fff8ca, #fff);
}

.kakao-action,
.ghost-action,
.plan-list button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.kakao-action {
  color: #392700;
  background: #fee500;
}

.ghost-action {
  color: var(--ink);
  background: #f2f2ec;
}

.plan-list {
  display: grid;
  gap: 10px;
  padding: 0 16px;
}

.plan-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #fff, #f1fffb);
}

.plan-list b {
  display: block;
  font-size: 16px;
}

.plan-list button {
  min-width: 110px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--lavender));
}

.payment-panel {
  background: #f7f4ff;
}

.payment-result dl {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px;
  margin: 18px 0;
  font-size: 13px;
}

.payment-result dt {
  color: var(--muted);
  font-weight: 900;
}

.payment-result dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.timeline-panel,
.year-panel {
  padding: 18px 16px;
}

.timeline-panel ol {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.timeline-panel li {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 7px;
  padding: 13px;
  background: #f5f1e8;
}

.timeline-panel span {
  color: var(--muted);
  font-size: 13px;
}

.year-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.year-panel p {
  width: 100%;
  margin-top: 7px;
}

.bottom-nav {
  height: 84px;
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  width: min(100%, 430px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 2px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(16px);
}

.bottom-nav > button {
  min-width: 0;
  min-height: 74px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  border: 0;
  color: #444846;
  background: transparent;
  font-size: 12px;
}

.bottom-nav > button img {
  width: 28px;
  height: 28px;
}

.bottom-nav > button.is-active {
  color: var(--rose);
  font-weight: 900;
}

.bottom-nav .fortune-fab {
  align-content: start;
  padding-top: 0;
  transform: translateY(-20px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.fortune-fab span {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 5px solid var(--white);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--lavender), #45c0c6);
  box-shadow: 0 10px 25px rgba(77, 57, 124, 0.26);
}

.fortune-fab span img {
  filter: brightness(0) invert(1);
}

.fortune-fab em {
  color: #54554f;
  font-style: normal;
}

.fortune-fab.fab-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(0px) scale(0.8);
  transition: opacity 180ms ease, transform 180ms ease;
}

@media (max-width: 360px) {
  .topbar {
    padding-inline: 10px;
  }

  .brand {
    width: 90px;
  }

  .brand-wordmark {
    width: auto;
  }

  .brand-text {
    font-size: 15px;
  }

  .top-tools {
    gap: 4px;
  }

  .auth-chip {
    max-width: 72px;
    padding-inline: 7px;
  }

  .product-copy footer {
    align-items: start;
    flex-direction: column;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

.form-step {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.step-heading b {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--jade);
  font-size: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented button,
.time-period-grid button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.segmented.small button {
  min-height: 38px;
  font-size: 13px;
}

.segmented button.is-active,
.time-period-grid button.is-active {
  border-color: #242424;
  color: #111;
  background: var(--gold);
  box-shadow: 3px 3px 0 rgba(36, 49, 69, 0.12);
}

.time-period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.time-period-grid b,
.time-period-grid span {
  display: block;
}

.time-period-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.hint-box {
  border: 1px solid #e6ead8;
  border-radius: 8px;
  padding: 11px 12px;
  color: #465446;
  background: #f7faee;
  font-size: 13px;
  line-height: 1.5;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--rose);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.member-modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.54);
  backdrop-filter: blur(5px);
}

.member-modal[hidden] {
  display: none;
}

.member-modal-card {
  width: min(100%, 380px);
  max-height: 82vh;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.member-modal-card header {
  padding: 22px 42px 14px;
  text-align: center;
}

.member-modal-card h2 {
  margin: 0;
  font-size: 20px;
}

.member-modal-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-close {
  width: 32px;
  height: 32px;
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  border-radius: 50%;
  background: #f2f2ec;
  font-size: 24px;
  line-height: 1;
}

.member-list {
  overflow: auto;
  padding: 4px 10px 10px;
}

.member-row {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.member-row:hover {
  background: #f7f3ec;
}

.avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 950;
  flex: 0 0 auto;
}

.member-meta {
  min-width: 0;
}

.member-meta b,
.member-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-meta small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chevron {
  color: #9ca3af;
  font-size: 26px;
}

.modal-add {
  min-height: 52px;
  margin: 8px 14px 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--rose);
  font-weight: 950;
}

.checkout-view {
  min-height: calc(100vh - 92px);
  background: #f5f5f2;
}

.checkout-panel,
.terms-row,
.checkout-actions {
  margin: 12px 16px;
}

.checkout-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #fff;
}

.checkout-panel h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.checkout-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 14px;
  background: #faf7ef;
}

.checkout-box span,
.amount-panel strong {
  color: var(--rose);
  font-weight: 950;
}

.checkout-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkout-profile p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.amount-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.amount-panel strong {
  font-size: 24px;
}

.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #343a40;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.terms-row input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.checkout-actions {
  display: grid;
  gap: 9px;
}

.secondary-action {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 950;
}

.analysis-view {
  background: #f4f1ea;
}

.analysis-hero {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 16px;
  background: var(--gold);
}

.analysis-hero > button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  font-size: 32px;
  line-height: 1;
}

.analysis-hero p,
.analysis-hero h1 {
  margin: 0;
}

.analysis-hero p {
  font-size: 13px;
  font-weight: 900;
}

.analysis-hero h1 {
  margin-top: 5px;
  font-size: 21px;
}

.analysis-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.analysis-chips span {
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 800;
}

/* ── 사이트 푸터 (사업자정보 + 약관 링크) ── */
.site-footer {
  margin: 28px 16px calc(80px + env(safe-area-inset-bottom));
  padding: 16px 4px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: 10px;
}
.footer-links button {
  background: none;
  border: 0;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 800;
  color: #57564f;
  cursor: pointer;
  text-decoration: underline;
}
.footer-business {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.footer-business span {
  font-size: 11px;
  line-height: 1.5;
  color: #9a988f;
}
.footer-business:empty {
  display: none;
}

/* ── 약관/개인정보/환불 화면 ── */
.legal-view {
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}
.legal-body {
  padding: 4px 16px 0;
}
.legal-body p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #3f3e39;
  white-space: pre-wrap;
  word-break: keep-all;
}

.analysis-section {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.analysis-section > h2 {
  margin: 0;
  padding: 12px 16px;
  color: #fff;
  background: var(--jade);
  text-align: center;
  font-size: 18px;
}

.manse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
}

.manse-column {
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.7);
  text-align: center;
}

.manse-label {
  padding: 9px 4px;
  color: #5d625d;
  background: #f1f2ee;
  font-size: 13px;
  font-weight: 900;
}

.manse-cell {
  min-height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.65);
}

.manse-cell strong {
  font-size: 31px;
  line-height: 1;
}

.manse-cell span,
.manse-cell small {
  font-size: 12px;
  font-weight: 800;
}

.manse-detail {
  min-height: 108px;
  display: grid;
  place-items: center;
  padding: 8px 4px;
  color: #666;
  background: #fbfaf7;
  font-size: 11px;
  line-height: 1.55;
}

.manse-detail hr {
  width: 24px;
  border: 0;
  border-top: 1px solid var(--line);
}

.manse-grid.is-compact .manse-cell {
  min-height: 64px;
}

.manse-grid.is-compact .manse-cell strong {
  font-size: 25px;
}

.analysis-loading {
  padding: 28px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: center;
}

.analysis-loading p {
  min-height: 26px;
  margin: 0;
  font-size: 17px;
  font-weight: 950;
}

.progress-track {
  height: 28px;
  position: relative;
  overflow: hidden;
  margin: 20px 0 12px;
  border-radius: 999px;
  background: #ece8de;
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  transition: width 0.25s ease;
}

.progress-track b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.analysis-loading small {
  color: var(--muted);
  font-weight: 800;
}

.accordion-hint {
  margin: 0;
  padding: 12px 16px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
}

.analysis-item {
  border-bottom: 1px solid var(--line);
}

.analysis-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  border: 0;
  padding: 16px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.analysis-toggle span {
  color: var(--rose);
  font-weight: 950;
}

.analysis-toggle b {
  line-height: 1.45;
}

.analysis-toggle i {
  color: var(--muted);
  font-style: normal;
  font-size: 20px;
  transition: transform 0.2s ease;
}

.analysis-item.is-open .analysis-toggle i {
  transform: rotate(180deg);
}

.analysis-body {
  display: none;
  padding: 0 16px 18px 52px;
  color: #3d4540;
  font-size: 16px;
  line-height: 1.75;
}

.analysis-item.is-open .analysis-body {
  display: block;
}

.analysis-body p {
  margin: 0 0 14px;
}

.related-products {
  padding: 18px 16px 28px;
  background: #fff;
}

.related-products h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.related-products button {
  width: 100%;
  display: grid;
  gap: 4px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf8;
  text-align: left;
  font: inherit;
}

.related-products button b {
  font-size: 14px;
  font-weight: 950;
}

.related-products button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.scroll-hint {
  position: sticky;
  top: 12px;
  z-index: 12;
  align-self: center;
  justify-self: center;
  margin: 14px auto 0;
  width: max-content;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(36, 49, 69, 0.18);
  animation: scrollHintBob 1.6s ease-in-out infinite;
  pointer-events: none;
}

.scroll-hint[hidden] {
  display: none;
}

@keyframes scrollHintBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.manse-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border-top: 1px solid var(--line);
}

.manse-info-grid > div {
  padding: 8px 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #545b54;
  line-height: 1.5;
}

.manse-info-grid > div:nth-child(4n) {
  border-right: 0;
}

.manse-info-grid > div:nth-child(8n+5),
.manse-info-grid > div:nth-child(8n+6),
.manse-info-grid > div:nth-child(8n+7),
.manse-info-grid > div:nth-child(8n+8) {
  background: #f8f6f0;
}

.manse-info-stars {
  font-size: 10.5px;
  color: #5b6157;
  font-weight: 700;
  line-height: 1.55;
}

.manse-grid-preview {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.archive-card {
  display: grid;
  gap: 6px;
  margin: 12px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #fffaef, #fff);
  box-shadow: 0 6px 16px rgba(29, 24, 16, 0.04);
}

.archive-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.archive-product {
  color: var(--rose);
  font-size: 12px;
  font-weight: 950;
}

.archive-status {
  color: #116c5c;
  background: #dcf7ef;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 900;
}

.archive-card b {
  font-size: 17px;
}

.archive-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-result.is-success h2,
[data-view="payment"].is-success h2 {
  color: var(--jade);
}

@media (max-width: 360px) {
  .analysis-body {
    padding-left: 16px;
  }

  .analysis-toggle {
    grid-template-columns: 22px minmax(0, 1fr) 18px;
  }
}

.clean-top {
  gap: 6px;
}

.top-link {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: #4d5149;
  background: #fffdf8;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.profile-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.profile-card.is-active {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(39, 169, 150, 0.12);
}

.profile-card b,
.profile-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card small {
  margin-top: 3px;
  color: var(--muted);
}

.time-chip {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
  text-align: center;
}

.time-chip.is-active {
  border-color: var(--gold);
  background: #fff6d7;
}

.time-chip b,
.time-chip span {
  display: block;
}

.time-chip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.report-section {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.report-section summary {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 16px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
}

.report-section summary::-webkit-details-marker {
  display: none;
}

.report-section summary span {
  color: var(--rose);
}

.report-section p {
  margin: 0;
  padding: 0 16px 18px 52px;
  color: #3d4540;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.75;
}

.order-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: #fff;
}

.order-card b,
.order-card span,
.order-card strong,
.order-card small {
  display: block;
}

.order-card span,
.order-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.order-card strong {
  text-align: right;
}

.order-card small.ok,
.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  color: #116c5c;
  background: #dcf7ef;
  font-weight: 900;
}

.empty-box {
  margin: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 18px;
  color: var(--muted);
  background: #fffdf8;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.admin-view {
  min-height: 100vh;
  background: #f4f1ea;
}

.admin-hero {
  padding: 20px 16px 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.74), rgba(39, 169, 150, 0.82)),
    url("./assets/generated/banners/saju-lab-hero.jpg") center/cover;
}

.admin-hero p,
.admin-hero h1 {
  margin: 0;
}

.admin-hero p {
  font-size: 13px;
  font-weight: 900;
  opacity: 0.9;
}

.admin-hero h1 {
  margin-top: 5px;
  font-size: 24px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-tabs button {
  min-width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.admin-tabs button.is-active {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.admin-metrics article {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.admin-metrics span,
.admin-metrics strong {
  display: block;
}

.admin-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-metrics strong {
  margin-top: 6px;
  font-size: 20px;
}

.admin-panel {
  margin: 0 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.admin-panel h2 {
  margin: 0;
  padding: 15px 16px 8px;
  font-size: 18px;
}

.admin-checklist,
.support-cards,
.settings-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.admin-checklist article,
.support-cards article,
.settings-grid article {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fffdf8;
}

.admin-checklist b,
.support-cards b,
.settings-grid b {
  display: block;
  margin-bottom: 4px;
}

.admin-checklist p,
.support-cards p,
.settings-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-table {
  overflow-x: auto;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 390px;
}

.admin-table td {
  border-top: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: middle;
  font-size: 13px;
}

.admin-table b,
.admin-table small {
  display: block;
}

.admin-table small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.admin-body {
  background: #ece8de;
}

.admin-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #f7f3ec;
  border-inline: 1px solid var(--line);
}

.admin-topbar {
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
}

.admin-wordmark,
.admin-back {
  color: var(--ink);
  text-decoration: none;
}

.admin-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.admin-wordmark span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fff8e8;
  background: var(--ink);
  font-weight: 950;
}

.admin-back {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.admin-hero-page {
  border-bottom: 1px solid var(--line);
}

.admin-tabs-page {
  position: sticky;
  top: 58px;
  z-index: 25;
}

.admin-help {
  margin: 0;
  padding: 0 16px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.product-admin-grid,
.prompt-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.admin-product-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fffdf8;
}

.admin-product-card label,
.admin-product-card header {
  display: grid;
  gap: 6px;
  color: #50564f;
  font-size: 12px;
  font-weight: 900;
}

.admin-product-card input,
.admin-product-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.admin-product-card textarea {
  resize: vertical;
}

.prompt-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.prompt-card header span {
  color: var(--muted);
  font-size: 11px;
}

.admin-save {
  grid-column: 1 / -1;
  min-height: 52px;
}

@media (max-width: 390px) {
  .top-link {
    padding: 0 8px;
    font-size: 11px;
  }

  .admin-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    border-inline: 0;
  }

  .product-admin-grid,
  .prompt-admin-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Admin sidebar layout (PC-first) ===== */
.admin-body {
  background: #eef0f4;
}

.admin-layout {
  width: min(1320px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: #f5f7fb;
  border-inline: 1px solid var(--line);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  overflow-y: auto;
}

.admin-sidebar .admin-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 6px 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 950;
}

.admin-sidebar .admin-wordmark span {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fff8e8;
  background: var(--ink);
  font-weight: 950;
}

.admin-side-nav {
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
}

.admin-side-nav button {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #404758;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.admin-side-nav button:hover {
  background: #f1f3f8;
}

.admin-side-nav button.is-active {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 6px 14px rgba(36, 49, 69, 0.18);
}

.admin-sidebar .admin-back {
  margin-top: 12px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 900;
}

.admin-main {
  min-width: 0;
  padding: 22px 26px 60px;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.admin-page-head p {
  margin: 0 0 4px;
  color: var(--jade);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.admin-page-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.admin-refresh {
  width: auto;
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
}

.admin-metrics-wide {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 0;
}

.admin-metrics-wide article {
  display: grid;
  gap: 4px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(36, 49, 69, 0.04);
}

.admin-metrics-wide span {
  color: #6c7382;
  font-size: 12px;
  font-weight: 900;
}

.admin-metrics-wide strong {
  font-size: 22px;
  line-height: 1.2;
}

.admin-metrics-wide small {
  color: #8a91a0;
  font-size: 11px;
  font-weight: 800;
}

.admin-main .admin-panel {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(36, 49, 69, 0.05);
}

.admin-main .admin-panel h2 {
  margin: 0;
  padding: 16px 18px 6px;
  font-size: 17px;
}

.admin-main .admin-help {
  margin: 0;
  padding: 0 18px 12px;
  color: #6c7382;
  font-size: 12.5px;
  line-height: 1.55;
}

.admin-main .admin-table {
  margin: 0 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow-x: auto;
}

.admin-main .admin-table table {
  min-width: 100%;
}

.admin-main .admin-table td {
  padding: 11px 14px;
  font-size: 13px;
}

.admin-main .admin-table tr:first-child td {
  border-top: 0;
}

.admin-main .admin-checklist,
.admin-main .support-cards,
.admin-main .settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 18px 18px;
}

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px 8px;
}

.funnel-grid article {
  display: grid;
  gap: 6px;
  padding: 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f6f8fd);
}

.funnel-grid span {
  color: #6c7382;
  font-size: 11.5px;
  font-weight: 900;
}

.funnel-grid strong {
  font-size: 20px;
  line-height: 1.2;
}

.funnel-grid div {
  height: 6px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
}

.funnel-grid i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--rose));
  font-style: normal;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 12px 14px;
}

.split-grid .admin-table {
  margin: 0;
}

/* Sparkline / time series */
.admin-trend {
  display: grid;
  gap: 12px;
  padding: 14px 18px 18px;
}

.admin-trend header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.admin-trend header h3 {
  margin: 0;
  font-size: 14px;
}

.admin-trend header span {
  color: #6c7382;
  font-size: 12px;
  font-weight: 800;
}

.trend-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 4px;
  height: 96px;
  padding: 6px 4px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.trend-bars span {
  display: block;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--jade), #5fcab6);
  min-height: 4px;
  position: relative;
}

.trend-bars span[data-zero="true"] {
  background: #eef0f4;
}

.trend-bars span::after {
  content: attr(data-label);
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  color: #6c7382;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.trend-bars span:hover::before {
  content: attr(data-value);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.distribution-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 18px 18px;
}

.distribution-grid section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 12px 14px;
}

.distribution-grid section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #404758;
}

.distribution-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.distribution-grid li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  font-size: 12.5px;
  color: #404758;
}

.distribution-grid li b {
  font-weight: 800;
}

.distribution-grid li span {
  color: #6c7382;
  font-weight: 800;
}

.distribution-grid .bar {
  height: 4px;
  margin-top: 2px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
  grid-column: 1 / -1;
}

.distribution-grid .bar i {
  display: block;
  height: 100%;
  background: var(--jade);
}

.journey-list {
  margin: 0;
  padding: 4px 18px 14px;
  display: grid;
  gap: 10px;
}

.journey-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.journey-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.journey-card header b {
  font-size: 13px;
}

.journey-card header span {
  color: #6c7382;
  font-size: 11.5px;
  font-weight: 800;
}

.journey-card .journey-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
  color: #404758;
}

.journey-card .journey-steps span {
  background: #eef0f4;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 800;
}

.journey-card .journey-steps span.is-paid {
  background: #e1f7ef;
  color: #0f7257;
}

@media (max-width: 1180px) {
  .admin-layout {
    grid-template-columns: 208px minmax(0, 1fr);
  }
  .admin-metrics-wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .funnel-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .distribution-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    gap: 6px;
  }
  .admin-sidebar .admin-wordmark { margin: 0 8px 0 0; }
  .admin-side-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 6px;
  }
  .admin-sidebar .admin-back { display: none; }
  .admin-main { padding: 16px; }
  .admin-metrics-wide,
  .admin-main .admin-checklist,
  .admin-main .support-cards,
  .admin-main .settings-grid,
  .distribution-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }
  .funnel-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Additional KPI row + funnel rate label */
.admin-metrics-kpi {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 10px;
}
@media (max-width: 1180px) {
  .admin-metrics-kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .admin-metrics-kpi {
    grid-template-columns: 1fr;
  }
}
.funnel-grid .funnel-rate {
  display: block;
  margin-top: 2px;
  color: #6c7382;
  font-size: 11px;
  font-weight: 800;
}

/* ---------- P0 fixes additions ---------- */
.calendar-grid button.today {
  outline: 2px solid var(--rose, #d97373);
  outline-offset: -2px;
  font-weight: 800;
}

.calendar-grid button.muted {
  color: #c4c8d0;
}

.calendar-grid button[disabled] {
  cursor: default;
  background: transparent;
}

.calendar-status {
  margin: 8px 16px 0;
  color: #c0394d;
  font-size: 12.5px;
  min-height: 16px;
}

.timeline-panel ol li {
  cursor: pointer;
  transition: background 120ms ease;
}

.timeline-panel ol li.is-active {
  background: #fff4cd;
  border-radius: 8px;
}

.year-panel button.is-active {
  background: #ffd97c;
  color: #463a16;
}

.compatibility-form [data-compat-status] {
  margin: 4px 0 0;
  color: #c0394d;
  font-size: 12.5px;
  min-height: 14px;
}

.checkout-pair {
  display: grid;
  gap: 8px;
}

.checkout-pair .pair-x {
  text-align: center;
  font-weight: 700;
  color: #6c7382;
  font-size: 14px;
}

.archive-card[data-archive-id] {
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 18px 16px;
  background: linear-gradient(90deg, #fff4cd, #fff);
  font: inherit;
}

.archive-card[data-archive-id]:hover {
  background: linear-gradient(90deg, #ffe8a3, #fff);
}
