/* Design tokens follow the Unity 3.0 wireframes: lavender gradient page, white cards, navy primary
   actions, green/yellow/red status chips. Light is the default; the SDK switches themes by toggling
   `theme-dark` on <html>. The wireframes are light-only, so dark values are a derivation. */
:root {
  --background: #F3F2F8;
  --surface: #FFFFFF;
  --surface-2: #F1F2F7;
  --surface-3: #E7E8F0;
  --divider: #E6E7EE;
  --on-surface: #1B2140;
  --on-surface-variant: #626782;
  --primary: #1F2B5B;
  --on-primary: #FFFFFF;
  --accent: #B5D334;
  --on-accent: #1B2140;
  --o2: #0A2BA6;
  --oneplay: #2A1A6E;
  --success-bg: #E4F4D2;
  --success-fg: #2E6B1F;
  --warning-bg: #FFF0BE;
  --warning-fg: #6B5300;
  --danger-bg: #FCE4E4;
  --danger-fg: #B3261E;
  --danger: #D23F31;
  --price-badge: #F2E26A;
  --on-price-badge: #1B2140;
  --chevron: #9DA2B4;
  --thumb-bg: linear-gradient(135deg, #CFE89A, #B5D334);
  --blob-1: rgba(196, 175, 245, 0.55);
  --blob-2: rgba(199, 232, 150, 0.5);
  --blob-3: rgba(250, 205, 165, 0.5);
  --blob-4: rgba(170, 205, 250, 0.5);
  --logo-filter: none;
  --scrim: rgba(27, 33, 64, 0.45);
  --shadow: rgba(27, 33, 64, 0.1);
  color-scheme: light;
}

html.theme-dark {
  --background: #15172B;
  --surface: #20233A;
  --surface-2: #2A2E48;
  --surface-3: #343857;
  --divider: #343857;
  --on-surface: #F2F3F8;
  --on-surface-variant: #AEB3C7;
  --primary: #5F74F5;
  --on-primary: #FFFFFF;
  --success-bg: #223A1E;
  --success-fg: #A6E08A;
  --warning-bg: #3E3414;
  --warning-fg: #F2D470;
  --danger-bg: #4A1F1F;
  --danger-fg: #FF8A80;
  --danger: #FF6F60;
  --price-badge: #D9C84A;
  --on-price-badge: #15172B;
  --chevron: #6E7390;
  --thumb-bg: linear-gradient(135deg, #4E6A1E, #7FA225);
  --blob-1: rgba(120, 95, 190, 0.35);
  --blob-2: rgba(110, 150, 70, 0.3);
  --blob-3: rgba(190, 130, 80, 0.28);
  --blob-4: rgba(80, 120, 190, 0.3);
  --logo-filter: brightness(0) invert(1);
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  color: var(--on-surface);
  background: var(--background);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Soft colour blobs stand in for the Unity ring artwork behind the page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(260px 220px at 85% 6%, var(--blob-1), transparent 70%),
    radial-gradient(240px 200px at 5% 22%, var(--blob-2), transparent 70%),
    radial-gradient(220px 200px at 95% 48%, var(--blob-3), transparent 70%),
    radial-gradient(260px 220px at 10% 92%, var(--blob-4), transparent 70%),
    var(--background);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3, p { margin: 0; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: linear-gradient(var(--background), rgba(243, 242, 248, 0));
}

html.theme-dark .topbar { background: linear-gradient(var(--background), rgba(21, 23, 43, 0)); }

.topbar h1 {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wordmark {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--on-surface);
}

.wordmark .dot { color: var(--accent); letter-spacing: 0; }

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--on-surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn:active { background: var(--surface-3); }
.icon-btn.invisible { visibility: hidden; }
.icon-btn.demo-btn { color: var(--on-surface-variant); }

main { padding: 4px 16px 40px; }

/* ----------------------------------------------------------------- shared */
.card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 6px 20px var(--shadow);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}

.section-title { font-size: 17px; font-weight: 700; }

.section-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-variant);
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.hscroll {
  display: flex;
  gap: 12px;
  margin: 0 -16px;
  padding: 2px 16px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex-shrink: 0; }

.button {
  display: block;
  width: 100%;
  border: 0;
  background: var(--primary);
  color: var(--on-primary);
  padding: 14px 18px;
  border-radius: 999px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  margin-top: 18px;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--on-surface);
  border: 1.5px solid var(--divider);
  margin-top: 10px;
}

.button.danger { background: var(--danger); color: #FFFFFF; }
.button.small { width: auto; display: inline-block; padding: 9px 16px; font-size: 13px; margin: 0; }
.button:active { filter: brightness(0.92); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
  cursor: pointer;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.status-success { background: var(--success-bg); color: var(--success-fg); }
.status-warning { background: var(--warning-bg); color: var(--warning-fg); }
.status-danger { background: var(--danger-bg); color: var(--danger-fg); }
.status-neutral { background: var(--surface-3); color: var(--on-surface-variant); }

.reward { font-size: 13px; font-weight: 700; white-space: nowrap; }
.reward small { font-size: 11px; font-weight: 500; color: var(--on-surface-variant); margin-left: 3px; }

.chevron { color: var(--chevron); font-size: 22px; line-height: 1; padding-left: 6px; }

.empty {
  margin: 28px 8px;
  color: var(--on-surface-variant);
  text-align: center;
  line-height: 1.45;
}

/* -------------------------------------------------------------- dashboard */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  margin-top: 8px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 14px var(--shadow);
  cursor: pointer;
}

.banner-icon { font-size: 18px; line-height: 1.2; }
.banner-text { flex: 1; }
.banner-title { font-size: 13.5px; font-weight: 700; }
.banner-desc { font-size: 12.5px; line-height: 1.4; color: var(--on-surface-variant); margin-top: 2px; }

.banner-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--on-surface-variant);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.banner-close svg { width: 18px; height: 18px; fill: currentColor; }

.hero {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  padding: 20px 20px 18px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 8px 24px var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: conic-gradient(#B18CF0, #5C8DF5, #B5D334, #F6A86A, #B18CF0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
  opacity: 0.9;
  pointer-events: none;
}

.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; position: relative; }
.hero-label { font-size: 13px; color: var(--on-surface-variant); }
.hero-amount { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin-top: 2px; }
.hero-link { margin-top: 2px; }

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  position: relative;
}

.pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.pill svg { width: 18px; height: 18px; fill: currentColor; }
.pill:active { filter: brightness(0.92); }

.partner-card {
  width: 148px;
  min-height: 176px;
  padding: 16px 14px 14px;
  border: 0;
  border-radius: 20px;
  text-align: left;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.partner-card.o2 { background: var(--o2); }
.partner-card.airbank { background: var(--accent); color: var(--on-accent); }
.partner-card.oneplay { background: var(--oneplay); }

.partner-logo { height: 22px; width: auto; max-width: 90px; object-fit: contain; object-position: left; }
.partner-reward { font-size: 28px; font-weight: 800; margin-top: 14px; line-height: 1; }
.partner-reward small { font-size: 12px; font-weight: 600; margin-left: 4px; }
.partner-period { font-size: 11.5px; opacity: 0.85; margin-top: 4px; }
.partner-text { font-size: 12px; line-height: 1.35; margin-top: 10px; flex: 1; }
.partner-text b { font-weight: 700; }

.partner-more {
  align-self: flex-start;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--on-surface);
  font-size: 12px;
  font-weight: 700;
}

html.theme-dark .partner-more { color: #1B2140; }

.start-card {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(120deg, #B18CF0, #5C8DF5, #B5D334, #F6A86A);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 6px 20px var(--shadow);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.start-main { flex: 1; }
.start-title { font-size: 15px; font-weight: 700; }
.start-text { font-size: 12.5px; line-height: 1.4; color: var(--on-surface-variant); margin-top: 4px; }
.start-cta { margin-top: 12px; }
.start-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.start-side .reward { font-size: 15px; }
.start-side img { width: 92px; height: 92px; object-fit: contain; margin-top: auto; }

.offer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.offer-tile {
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 6px 20px var(--shadow);
  text-align: left;
  color: var(--on-surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.offer-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
}

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

.price-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 10px;
  background: var(--price-badge);
  color: var(--on-price-badge);
  text-align: right;
  line-height: 1.1;
}

.price-old { font-size: 10px; text-decoration: line-through; opacity: 0.8; }
.price-label { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }
.price-new { font-size: 13px; font-weight: 800; }

.free-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 700;
}

.offer-body { padding: 10px 12px 12px; }
.offer-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.offer-sub { font-size: 11.5px; line-height: 1.35; color: var(--on-surface-variant); margin-top: 3px; }

.comp-card {
  position: relative;
  width: 280px;
  height: 160px;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-3);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.comp-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.comp-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.75));
}

.comp-badge {
  position: absolute;
  z-index: 1;
  left: 12px;
  top: 12px;
  padding: 5px 8px;
  border-radius: 10px;
  background: var(--price-badge);
  color: var(--on-price-badge);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.15;
}

.comp-badge b { display: block; font-size: 13px; text-transform: none; }

.comp-body {
  position: absolute;
  z-index: 1;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.comp-title { font-size: 15px; font-weight: 700; }
.comp-sub { font-size: 11.5px; line-height: 1.3; opacity: 0.9; margin-top: 2px; }

.comp-cta {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: #FFFFFF;
  color: #1B2140;
  font-size: 12px;
  font-weight: 700;
}

.dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--chevron); opacity: 0.5; }
.dots span:first-child { width: 16px; opacity: 1; background: var(--primary); }

/* ------------------------------------------------------------------- earn */
.month-card {
  margin-top: 8px;
  padding: 14px 14px 14px;
  border-radius: 20px;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 24px var(--shadow);
}

.month-nav { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.month-center { flex: 1; text-align: center; }
.month-head { font-size: 14px; font-weight: 600; opacity: 0.95; }
.month-amount { font-size: 28px; font-weight: 800; margin-top: 2px; }
.month-text { font-size: 12px; line-height: 1.4; opacity: 0.85; margin-top: 8px; padding: 0 6px; }

.month-arrow {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.month-arrow svg { width: 20px; height: 20px; fill: currentColor; }
.month-arrow[disabled] { opacity: 0.25; cursor: default; }

.howto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 14px;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--on-surface);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.howto svg { width: 18px; height: 18px; fill: currentColor; transition: transform 0.15s; }
.howto.open svg { transform: rotate(180deg); }

.howto-list {
  margin: 0;
  padding: 12px 14px 4px 30px;
  border-radius: 0 0 12px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--on-surface);
  background: var(--surface);
  margin-top: -8px;
  padding-top: 14px;
}

.howto-list li { margin-bottom: 8px; }

.basic-card {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  text-align: left;
  color: var(--on-surface);
  background: var(--surface);
  border: 1.5px solid var(--success-fg);
  cursor: pointer;
}

.basic-card.failed { border-color: var(--danger-fg); background: linear-gradient(0deg, var(--danger-bg), var(--danger-bg)), var(--surface); }
.basic-card.pending { border-color: var(--warning-fg); }
.basic-top { display: flex; align-items: center; gap: 10px; }

.basic-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.basic-icon svg { width: 18px; height: 18px; fill: var(--on-surface); }
.basic-title { font-size: 13.5px; font-weight: 700; }
.basic-sub { font-size: 12px; color: var(--on-surface-variant); margin-top: 1px; }
.basic-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.chips {
  display: flex;
  gap: 8px;
  margin: 16px 0 12px;
}

.chip-filter {
  flex: 1;
  height: 44px;
  padding: 0 8px;
  border: 1.5px solid var(--divider);
  border-radius: 12px;
  background: var(--surface);
  color: var(--on-surface);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chip-filter img { height: 24px; width: auto; max-width: 72px; object-fit: contain; }
.chip-filter.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }

.cond-list { display: flex; flex-direction: column; gap: 10px; }

.cond-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  color: var(--on-surface);
  cursor: pointer;
  width: 100%;
}

.cond-thumb {
  width: 56px;
  min-height: 56px;
  border-radius: 12px;
  background: var(--thumb-bg);
  display: grid;
  place-items: center;
  font-size: 26px;
  flex-shrink: 0;
  align-self: flex-start;
}

.cond-thumb.o2 { background: linear-gradient(135deg, #2C50D6, var(--o2)); }
.cond-thumb.oneplay { background: linear-gradient(135deg, #5B3FBF, var(--oneplay)); }
.cond-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.cond-main { flex: 1; min-width: 0; }
.cond-head { display: flex; align-items: flex-start; gap: 6px; }
.cond-title { font-size: 13.5px; font-weight: 700; flex: 1; }
.cond-desc { font-size: 12px; line-height: 1.35; color: var(--on-surface-variant); margin-top: 2px; }
.cond-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 6px 0 0;
  padding: 8px 2px;
  border: 0;
  background: none;
  color: var(--on-surface);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.group-head svg { width: 18px; height: 18px; fill: currentColor; transition: transform 0.15s; }
.group-head.open svg { transform: rotate(180deg); }

.month-link { display: flex; justify-content: flex-end; margin-top: 18px; }
.month-link.left { justify-content: flex-start; }

/* ----------------------------------------------------------------- detail */
.illus {
  margin-top: 8px;
  height: 150px;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1.5px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(120deg, #B18CF0, #5C8DF5, #B5D334, #F6A86A);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.illus img { max-height: 120px; max-width: 70%; object-fit: contain; }

.illus.product {
  border: 0;
  background: linear-gradient(135deg, #DFF0B0, #B5D334);
  font-size: 64px;
}

.illus.product.o2 { background: linear-gradient(135deg, #3B5FE0, var(--o2)); }
.illus.product.oneplay { background: linear-gradient(135deg, #6B4FD0, var(--oneplay)); }

.detail { padding: 18px 2px 0; }
.detail h2 { font-size: 17px; font-weight: 700; line-height: 1.3; }
.detail .lead { font-size: 12.5px; line-height: 1.45; color: var(--on-surface-variant); margin-top: 6px; }
.detail h3 { font-size: 14px; font-weight: 700; margin: 20px 0 10px; }

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.rule-list { display: flex; flex-direction: column; gap: 8px; }

.rule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  color: var(--on-surface);
  width: 100%;
}

button.rule { cursor: pointer; }
button.rule:active { background: var(--surface-2); }

.rule-icon {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rule-icon svg { width: 18px; height: 18px; fill: var(--on-surface); }
.rule-icon.done { background: var(--on-surface); }
.rule-icon.done svg { fill: var(--surface); }
.rule-main { flex: 1; min-width: 0; }
.rule-title { font-size: 13px; font-weight: 700; }
.rule-desc { font-size: 11.5px; line-height: 1.35; color: var(--on-surface-variant); margin-top: 2px; }

.alert-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: var(--danger-bg);
  color: var(--danger-fg);
}

.alert-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.alert-title svg { width: 18px; height: 18px; fill: currentColor; }
.alert-text { font-size: 12.5px; line-height: 1.4; margin-top: 6px; }
.alert-card .button { margin-top: 12px; padding: 11px; font-size: 14px; }
.alert-card .button + .button { margin-top: 8px; }

.prompt-card {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--divider);
}

.prompt-main { flex: 1; }
.prompt-title { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.prompt-text { font-size: 12px; line-height: 1.4; color: var(--on-surface-variant); margin-top: 4px; }
.prompt-card .button { margin-top: 12px; padding: 11px; font-size: 14px; }
.prompt-mark { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }

.instance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0 8px;
}

.instance-name { font-size: 14px; font-weight: 700; flex: 1; }

/* ----------------------------------------------------------- offer & order */
.offer-hero {
  position: relative;
  margin-top: 8px;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-2);
}

.offer-hero img { width: 100%; height: 100%; object-fit: cover; }
.offer-hero .price-badge { right: 12px; bottom: 12px; padding: 8px 12px; }
.offer-hero .price-old { font-size: 12px; }
.offer-hero .price-label { font-size: 10px; }
.offer-hero .price-new { font-size: 17px; }
.offer-hero .free-badge { right: 12px; bottom: 12px; }

.meta-pill {
  display: inline-block;
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--on-surface-variant);
  margin: 10px 6px 0 0;
}

.meta-pill b { color: var(--on-surface); font-weight: 700; }

.order-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border-radius: 18px;
  padding: 12px;
  margin-top: 14px;
}

.order-card img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--surface-2);
}

.order-card strong { display: block; font-size: 15px; }
.order-card span { display: block; font-size: 12.5px; color: var(--on-surface-variant); margin-top: 2px; }

.note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 1.4;
}

pre.note { white-space: pre-wrap; word-break: break-word; font: 12px/1.45 ui-monospace, Menlo, monospace; }

/* ---------------------------------------------------------------- history */
.history-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
}

.history-month { font-size: 14px; font-weight: 700; }
.history-note { font-size: 12px; color: var(--on-surface-variant); margin-top: 2px; }
.history-amount { font-size: 15px; font-weight: 800; }
.history-amount.zero { color: var(--on-surface-variant); }

/* ---------------------------------------------------------------- profile */
.profile-intro { padding: 8px 2px 4px; }
.profile-header { color: var(--on-surface-variant); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.profile-title { margin-top: 4px; font-size: 18px; font-weight: 700; line-height: 1.3; }

.profile-list {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-row {
  padding: 0;
  border: 0;
  text-align: left;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  color: var(--on-surface);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--shadow);
}

.profile-row-image { position: relative; height: 110px; overflow: hidden; background: var(--surface-2); }
.profile-row-image img.bg { width: 100%; height: 100%; object-fit: cover; }
.profile-row-logo { position: absolute; left: 12px; top: 12px; width: 34px; height: 34px; object-fit: contain; }

.profile-row-body {
  padding: 12px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-row-header { font-size: 15px; font-weight: 700; }
.status-pill { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status-pill.paired { background: var(--success-bg); color: var(--success-fg); }
.status-pill.unpaired { background: var(--surface-3); color: var(--on-surface); }

.offer-group-title { margin: 22px 0 8px; font-size: 14px; font-weight: 700; }
.offer-card { background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.offer-card p { color: var(--on-surface-variant); font-size: 13px; line-height: 1.45; margin-bottom: 12px; }
.offer-card .button { margin-top: 0; padding: 11px; font-size: 14px; }

/* ------------------------------------------------------------ error screen */
.error-screen { text-align: center; padding: 48px 8px 8px; }
.error-screen .icon { font-size: 56px; }
.error-screen h2 { margin: 10px 0 6px; font-size: 18px; }
.error-screen p { color: var(--on-surface-variant); font-size: 13.5px; line-height: 1.45; margin-bottom: 12px; }

code {
  display: inline-block;
  background: var(--surface);
  color: var(--on-surface);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 13px;
}

/* ------------------------------------------------------------- demo panel */
.demo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  max-height: 70vh;
  overflow-y: auto;
  padding: 12px 16px 24px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px var(--shadow);
}

.demo-header { display: flex; align-items: center; }
.demo-header h2 { flex: 1; font-size: 15px; }
.demo h3 { margin: 16px 0 6px; font-size: 12px; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: 0.5px; }

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.demo-grid button {
  padding: 10px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--on-surface);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.demo-grid button.danger { color: var(--danger); }
.demo-grid button.on { background: var(--primary); color: var(--on-primary); }

#log {
  margin: 0;
  max-height: 180px;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--background);
  font: 12px/1.45 ui-monospace, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ------------------------------------------------------------ bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); }

.sheet-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  overflow: auto;
  padding: 10px 20px 28px;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 -12px 32px var(--shadow);
}

.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--divider); margin: 0 auto 14px; }
.sheet-card h2 { font-size: 16px; font-weight: 700; text-align: center; line-height: 1.3; padding: 0 12px; }

.sheet-body { margin-top: 16px; font-size: 13.5px; line-height: 1.5; color: var(--on-surface-variant); }
.sheet-body p { margin-bottom: 10px; }
.sheet-body pre { margin: 0; font: 12px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.sheet-section { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--on-surface); margin-bottom: 6px; }
.sheet-section svg { width: 18px; height: 18px; fill: currentColor; }

.sheet-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.sheet-buttons .button { margin: 0; }

.hidden { display: none !important; }
