/* /studio home: the catalogue of outcomes (Direction A "Pilih Hasil", 2026-10-02).
   Loaded AFTER studio.css; everything is scoped under body.app-home so no other studio page changes.
   Tokens come from theme.css / studio.css. Class names are prefixed o- / app- so they cannot collide
   with studio.css (.btn, .card, .badge, .chip all exist there with other meanings). */

body.app-home { background: #fafafa; }

/* ---------- header: wordmark, Tanya, balance or Log masuk ---------- */
.app-home .topbar { padding-top: calc(10px + var(--safe-top)); padding-bottom: 10px; }
.app-home .topbar-brand { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0; color: var(--text); text-decoration: none; }
.app-top-r { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.app-pill {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; background: #fff; border: 1px solid #d8ddd9; color: var(--text);
  font: 800 14px/1 var(--font-body); white-space: nowrap; cursor: pointer; text-decoration: none;
}
.app-pill:active { transform: scale(0.97); }
.app-pill .carrot { font-size: 16px; line-height: 1; }
.app-pill.has-unread::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
}
.app-home .credits-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  background: #eef6f0; color: #0F5B3A; border-radius: 999px; font: 800 14px/1 var(--font-body); text-decoration: none;
}
.app-home .credits-chip[hidden], .app-login-chip[hidden] { display: none; }
.app-home .credits-chip svg { width: 14px; height: 14px; fill: var(--accent); stroke: none; }
.app-login-chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: #eef6f0; color: #0F5B3A; font: 800 14px/1 var(--font-body); text-decoration: none; white-space: nowrap;
}

/* ---------- shell ---------- */
.app-wrap { max-width: 560px; margin: 0 auto; padding: 0 0 26px; }   /* the room for the phone tab bar is on body (header.css) */
.app-view[hidden] { display: none; }
.app-pad { padding-left: 16px; padding-right: 16px; }
.app-wrap h1, .app-wrap h2, .app-wrap h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; text-wrap: balance; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- buttons ---------- */
.o-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 8px 16px;
  border-radius: 12px; border: 0; background: #e65f00; color: #fff; font: 700 19px/1.15 var(--font-display);
  text-align: center; text-wrap: balance; text-decoration: none; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.16);
}
.o-btn:active { transform: translateY(1px); }
.o-btn.ghost { background: #fff; color: #0F5B3A; border: 2px solid #0F5B3A; box-shadow: none; font-size: 17px; min-height: 48px; }
.o-link {
  display: flex; align-items: center; justify-content: center; min-height: 44px; color: #0F5B3A; font-weight: 800; font-size: 16px;
  text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; font-family: inherit; width: 100%;
}

/* ---------- badges ---------- */
.o-badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; border-radius: 999px; font: 800 12px/1 var(--font-body); overflow: hidden; white-space: nowrap; }
.o-badge .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.o-badge.web { background: #e4ece7; color: #0F5B3A; padding: 0 10px; }
.o-badge.wa { background: #25D366; color: #062413; padding: 0 10px 0 8px; }
.o-badge.both { gap: 0; }
.o-badge.both i { font-style: normal; display: inline-flex; align-items: center; height: 24px; padding: 0 6px 0 9px; background: #e4ece7; color: #0F5B3A; }
.o-badge.both b { font-weight: 800; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px 0 7px; background: #25D366; color: #062413; }

/* ---------- Buat: intro, hero ---------- */
.app-intro { padding: 10px 16px 16px; }
.app-intro h1 { font-size: 28px; font-weight: 700; }
.app-intro p { margin-top: 6px; font-size: 16px; color: var(--text-soft); }

.o-hero { margin: 0 16px; background: #062413; color: #fff; border-radius: 20px; padding: 16px; }
.o-hero h2 { font-size: 22px; font-weight: 600; line-height: 1.2; margin-bottom: 6px; }
.o-hero h2 em { font-style: normal; color: #4ade80; }
.o-hero-sub { font-size: 14px; color: rgba(255,255,255,.88); margin-bottom: 14px; }
.o-flow { display: flex; align-items: center; gap: 6px; }
.o-flow figure { position: relative; flex: 1 1 0; min-width: 0; height: 150px; border-radius: 12px; overflow: hidden; background: #0c3a22; margin: 0; }
.o-flow figure.last { box-shadow: 0 0 0 2px #1FA66F; }
.o-flow img { width: 100%; height: 100%; object-fit: cover; }
.o-flow figcaption { position: absolute; left: 6px; bottom: 6px; background: rgba(6,36,19,.85); color: #fff; font: 800 12px/1 var(--font-body); padding: 5px 7px; border-radius: 8px; }
.o-flow .op { flex: none; width: 16px; display: grid; place-items: center; color: #4ade80; font: 700 18px/1 var(--font-display); }
.o-flow .op .ic { width: 16px; height: 16px; }
.o-flow .o-play { width: 26px; height: 26px; right: 5px; bottom: 5px; }
.o-flow .o-play .ic { width: 11px; height: 11px; }
.o-hero .o-btn { margin-top: 16px; }
.o-hero small { display: block; margin-top: 10px; font-size: 14px; color: rgba(255,255,255,.82); text-align: center; }

/* ---------- Buat: sections and cards ---------- */
.o-sec { padding: 26px 16px 0; }
.o-sec h2 { font-size: 22px; margin-bottom: 12px; }
.o-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.o-card {
  position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); overflow: hidden; color: inherit; text-decoration: none;
}
.o-card:active { transform: scale(.99); }
.o-thumb { position: relative; height: 140px; background: #dfe6e1; overflow: hidden; }
.o-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.o-thumb .tag { position: absolute; left: 8px; bottom: 8px; background: rgba(6,36,19,.85); color: #fff; font: 800 12px/1 var(--font-body); padding: 5px 8px; border-radius: 8px; max-width: calc(100% - 52px); }
.o-play { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #062413; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.o-play .ic { width: 14px; height: 14px; margin-left: 2px; }
.o-split { display: flex; height: 100%; }
.o-split img { width: 50%; height: 100%; object-fit: cover; }
.o-split .mid { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #ffae00; color: #062413; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.o-split .mid .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.o-bubble { position: absolute; left: 8px; top: 8px; max-width: 118px; background: #fff; color: #062413; font: 800 12px/1.25 var(--font-body); padding: 6px 9px; border-radius: 12px 12px 12px 3px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.o-body { display: flex; flex-direction: column; gap: 6px; padding: 12px; flex: 1; }
.o-body h3 { font-size: 16px; line-height: 1.2; min-height: 38px; }
.o-line { font-size: 14px; line-height: 1.3; color: var(--text-soft); }
.o-price { font-size: 14px; line-height: 1.3; color: var(--text-soft); min-height: 36px; }
.o-price b { font-weight: 800; color: #0F5B3A; }
.o-body .o-badge { align-self: flex-start; margin-top: auto; }
.o-go { font-size: 14px; font-weight: 800; color: #0F5B3A; }

.o-special { margin: 26px 16px 0; }
.o-special h2 { font-size: 22px; margin-bottom: 12px; }
.o-sp-card { display: block; background: #fefce8; border: 1px solid #efe7b3; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-md); color: inherit; text-decoration: none; }
.o-sp-card .o-thumb { height: auto; aspect-ratio: 720 / 406; }
.o-sp-body { padding: 14px 16px 16px; }
.o-sp-body h3 { font-size: 20px; }
.o-sp-body p { margin-top: 4px; font-size: 14px; color: var(--text-soft); }
.o-sp-price { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }
.o-sp-price strong { font: 700 28px/1 var(--font-display); color: #0F5B3A; }
.o-sp-price span { font-size: 14px; font-weight: 800; color: #062413; }


/* ---------- Hasil saya ---------- */
.app-title { padding: 6px 16px 12px; }
.app-title h1 { font-size: 28px; font-weight: 700; }
.app-chips { display: flex; gap: 8px; padding: 0 16px 18px; flex-wrap: wrap; }
.app-chip { position: relative; min-height: 44px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid #d8ddd9; font: 800 14px/1 var(--font-body); color: #062413; cursor: pointer; }
.app-chip[aria-pressed="true"] { background: #062413; border-color: #062413; color: #fff; }
.app-lh { font-size: 18px; margin: 0 16px 10px; }
.app-block { padding-bottom: 8px; }
.app-block[hidden] { display: none; }
.mk { margin: 0 16px 12px; background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-md); padding: 14px; }
.mk-top { display: flex; gap: 14px; }
.mk-img { position: relative; width: 72px; height: 104px; border-radius: 12px; overflow: hidden; background: #123322; flex: none; }
.mk-img img { width: 100%; height: 100%; object-fit: cover; }
.mk-img .lib-spin-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mk-info h3 { font-size: 17px; }
.mk-info p { margin-top: 4px; font-size: 14px; color: var(--text-soft); }
.mk-prog { margin-top: auto; }
.mk-bar { height: 8px; border-radius: 999px; background: #e4ece7; overflow: hidden; position: relative; }
.mk-bar i { position: absolute; top: 0; bottom: 0; width: 38%; border-radius: 999px; background: #1FA66F; animation: mk-slide 1.6s ease-in-out infinite; }
@keyframes mk-slide { 0% { left: -38%; } 100% { left: 100%; } }
.mk-prog small { display: block; margin-top: 6px; font-size: 14px; font-weight: 800; color: #0F5B3A; }
@media (prefers-reduced-motion: reduce) { .mk-bar i { animation: none; left: 0; width: 100%; opacity: .5; } }
.mk-note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #eef6f0; font-size: 14px; font-weight: 700; line-height: 1.3; }

.app-done { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
@media (min-width: 560px) { .app-done { grid-template-columns: repeat(3, 1fr); } }
.lcard { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); overflow: hidden; display: flex; flex-direction: column; }
.lib-card { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #123322; height: 150px; font: inherit; color: inherit; text-align: left; cursor: pointer; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.lib-card:active { transform: scale(.985); }
.lib-card[disabled] { cursor: default; }
.lib-card[disabled]:active { transform: none; }
.lib-media { position: absolute; inset: 0; background: #123322; }
.lib-media img, .lib-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-badge { position: absolute; left: 7px; bottom: 7px; z-index: 3; font-size: 12px; font-weight: 800; border-radius: 8px; padding: 5px 8px; background: rgba(6,36,19,.85); color: #fff; line-height: 1; }
.lib-badge-play { right: 7px; left: auto; bottom: 7px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; font-size: 11px; border-radius: 50%; background: #fff; color: #062413; }
.lib-more { position: absolute; right: 7px; top: 7px; z-index: 3; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 9px; background: rgba(6,36,19,.85); color: #fff; }
.lib-spin-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.lib-dead { font-size: 24px; opacity: .8; color: #fff; }
.lib-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.22); border-top-color: var(--accent); animation: lib-rot .9s linear infinite; }
@keyframes lib-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lib-spin { animation-duration: 2.6s; } .lib-card:active { transform: none; } }
.lb { padding: 10px 12px 4px; flex: 1; }
.lb h3 { font-size: 16px; line-height: 1.2; min-height: 38px; }
.lb .meta { font-size: 14px; color: var(--text-soft); margin-top: 2px; }
.lib-warn { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 8px; color: #7c2d12; background: #ffedd5; }
.acts { display: flex; justify-content: space-between; padding: 0 4px 4px; }
.acts button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #0F5B3A; background: none; border: 0; cursor: pointer; text-decoration: none; }
.acts a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #0F5B3A; text-decoration: none; }
.acts button:active, .acts a:active { background: #eef6f0; }
.acts .ic { width: 22px; height: 22px; }
.acts [disabled] { opacity: .35; cursor: default; }

.app-empty { margin: 8px 16px 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px 16px; text-align: center; }
.app-empty .glyph { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 50%; background: #eef6f0; color: #0F5B3A; display: grid; place-items: center; }
.app-empty .glyph .ic { width: 24px; height: 24px; }
.app-empty h3 { font-size: 20px; }
.app-empty p { margin: 6px 0 16px; font-size: 14px; color: var(--text-soft); }
.app-empty .o-btn { margin-bottom: 8px; }
.app-wa-note { margin: 16px 16px 0; font-size: 14px; color: var(--text-soft); text-align: center; }
.app-msg { margin: 8px 16px; font-size: 14px; color: var(--text-soft); }

/* ---------- Akaun ---------- */
.ak-card { margin: 0 16px 14px; background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-md); padding: 16px; }
.ak-card h2 { font-size: 18px; margin-bottom: 6px; }
.ak-card p { font-size: 14px; color: var(--text-soft); }
.ak-card .o-btn + .o-btn, .ak-card .o-btn + .o-link { margin-top: 8px; }
.ak-links { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; padding: 4px 16px 0; font-size: 14px; }
.ak-links a, .ak-links button { display: inline-flex; align-items: center; min-height: 44px; color: #0F5B3A; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; font-family: inherit; font-size: 14px; cursor: pointer; }
.app-view .referral-card, .app-view .tg-card { margin-left: 16px; margin-right: 16px; }

/* ---------- bottom nav: moved to /header.css (shared by every studio page, phone only) ---------- */

/* ---------- no floating bubbles on the app screen: help lives in the header ("Tanya") ---------- */
.app-home .sw-fab { display: none !important; }

/* The 'Hasil saya' viewer (full-screen, above everything). Unchanged behaviour from the old library. */
.lib-viewer { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: 10000; background: rgba(6,36,19,.96); }
.lib-viewer[hidden] { display: none; }
.lib-v-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; color: #fff; flex: 0 0 auto; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.lib-v-title { font-size: 14px; font-weight: 800; }
.lib-v-count { font-size: 12px; opacity: .75; margin-left: 8px; font-weight: 600; }
.lib-v-close { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; line-height: 1; }
.lib-v-strip { flex: 1 1 auto; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.lib-v-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.lib-v-slide img, .lib-v-slide video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.lib-v-bottom { flex: 0 0 auto; padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
.lib-v-hint { text-align: center; font-size: 12px; color: rgba(255,255,255,.7); margin-bottom: 8px; }
.lib-v-save { width: 100%; }

/* welcome alert (after sign-up) */
.app-home #welcome-slot .alert { margin: 8px 16px 0; }

.app-h { font-size: 28px; font-weight: 700; }
.app-intro .app-h { margin: 0; }
.credits-chip-unit { display: none; }
@media (min-width: 400px) { .app-home .credits-chip-unit { display: inline; } }

.app-home .topbar-brand { min-height: 44px; }
.app-home .caption-pill { min-height: 44px; }
#referral-share-native[hidden] { display: none; }
.app-home .tg-card-cta { min-height: 44px; }
