:root {
  --ink: #231f33;
  --muted: #716a7f;
  --soft: #fbf8f4;
  --card: rgba(255,255,255,.86);
  --line: rgba(63, 51, 93, .13);
  --purple: #6f63ff;
  --purple-2: #b173ff;
  --mint: #b6f0da;
  --rose: #f6c6d6;
  --blue: #dceeff;
  --shadow: 0 20px 60px rgba(44, 35, 70, .11);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --nav-h: 82px;
}
* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100%; margin: 0; color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 4%, rgba(177,115,255,.23), transparent 26rem),
    radial-gradient(circle at 90% 8%, rgba(182,240,218,.33), transparent 22rem),
    radial-gradient(circle at 50% 94%, rgba(246,198,214,.32), transparent 28rem),
    var(--soft);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 780px; margin: 0 auto; min-height: 100vh; position: relative; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem;
  padding: .85rem .95rem; backdrop-filter: blur(24px);
  background: rgba(251,248,244,.78); border-bottom: 1px solid rgba(255,255,255,.8);
}
.icon-btn, .install-btn, .soft-btn, .primary-btn, .ghost-btn, .chip-btn {
  border: 0; border-radius: 999px; min-height: 44px; padding: .78rem 1rem;
  background: rgba(255,255,255,.82); color: var(--ink); box-shadow: 0 10px 25px rgba(44,35,70,.08);
}
.icon-btn { width: 44px; padding: 0; font-size: 1.3rem; }
.install-btn { background: #231f33; color: #fff; font-weight: 800; }
.brand { border: 0; background: transparent; display: flex; align-items: center; gap: .68rem; min-width: 0; color: var(--ink); padding: .2rem 0; text-align: left; }
.brand-logo { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 14px; color: #fff; font-weight: 900; background: linear-gradient(135deg, var(--purple), var(--purple-2)); box-shadow: 0 10px 24px rgba(111,99,255,.24); flex: 0 0 auto; }
.brand-logo.large { width: 54px; height: 54px; border-radius: 19px; font-size: 1.35rem; }
.brand-text { display: grid; min-width: 0; }
.brand-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .75rem; }
.screen { padding: 1rem 1rem calc(var(--nav-h) + 1.3rem); min-height: calc(100vh - 72px); outline: none; }
.section { animation: rise .22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.hero {
  border: 1px solid rgba(255,255,255,.82); border-radius: 34px; padding: 1.3rem;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(245,239,255,.92)); box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero::after { content: ""; position: absolute; right: -50px; top: -45px; width: 160px; height: 160px; border-radius: 50%; background: rgba(182,240,218,.45); }
.kicker { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .38rem .7rem; color: #5d4aff; font-size: .8rem; font-weight: 900; background: rgba(111,99,255,.1); border: 1px solid rgba(111,99,255,.12); }
h1, h2, h3 { margin: 0; letter-spacing: -.04em; }
h1 { font-size: clamp(2rem, 8vw, 4rem); line-height: .98; margin-top: .8rem; max-width: 12ch; }
h2 { font-size: clamp(1.5rem, 6vw, 2.6rem); line-height: 1.02; margin-bottom: .6rem; }
h3 { font-size: 1.15rem; line-height: 1.1; }
p { line-height: 1.58; margin: .6rem 0; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 40rem; }
.price-pill { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .45rem .75rem; background: #231f33; color: #fff; font-weight: 900; font-size: .85rem; margin-top: .65rem; }
.grid { display: grid; gap: .85rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.card {
  background: var(--card); border: 1px solid rgba(255,255,255,.78); border-radius: var(--radius-xl);
  padding: 1rem; box-shadow: 0 16px 45px rgba(44,35,70,.08); backdrop-filter: blur(18px);
}
.card.compact { border-radius: var(--radius-lg); }
.card-button { width: 100%; border: 1px solid rgba(255,255,255,.75); border-radius: var(--radius-xl); padding: 1rem; text-align: left; background: rgba(255,255,255,.85); box-shadow: 0 14px 34px rgba(44,35,70,.08); color: var(--ink); min-height: 108px; display: grid; gap: .5rem; }
.card-button strong { font-size: 1.05rem; }
.card-button small { color: var(--muted); line-height: 1.35; }
.action-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .9rem; }
.primary-btn { background: linear-gradient(135deg, var(--purple), var(--purple-2)); color: #fff; font-weight: 900; }
.ghost-btn { background: rgba(255,255,255,.75); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.soft-btn { background: rgba(111,99,255,.1); color: #5143d9; font-weight: 850; box-shadow: none; }
.full { width: 100%; }
.block-title { margin: 1.35rem 0 .7rem; display: flex; align-items: end; justify-content: space-between; gap: .8rem; }
.block-title small { color: var(--muted); }
.program-card { display: grid; gap: .75rem; position: relative; overflow: hidden; }
.program-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--accent, var(--purple)); }
.meta-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.meta { border-radius: 999px; padding: .35rem .6rem; background: rgba(35,31,51,.06); color: var(--muted); font-size: .78rem; font-weight: 800; }
.meta.premium { background: rgba(111,99,255,.12); color: #5143d9; }
.progress { height: 9px; border-radius: 999px; overflow: hidden; background: rgba(35,31,51,.08); }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent, var(--purple)), var(--purple-2)); width: 0; }
.reader-head { display: grid; gap: .65rem; margin-bottom: .8rem; }
.step-card { background: rgba(255,255,255,.92); border-radius: 34px; border: 1px solid rgba(255,255,255,.84); padding: 1rem; box-shadow: var(--shadow); }
.step-meta { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .75rem; color: var(--muted); font-size: .82rem; font-weight: 900; }
.step-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: .38rem .65rem; background: rgba(111,99,255,.1); color: #5143d9; }
.step-title { font-size: clamp(1.55rem, 7vw, 3rem); line-height: 1.02; }
.body { display: grid; gap: .55rem; margin-top: 1rem; }
.body p { margin: .18rem 0; }
.body ul, .body ol { margin: .2rem 0; padding-left: 1.3rem; }
.body li { margin: .32rem 0; line-height: 1.45; }
.prompt { display: grid; gap: .45rem; margin: .55rem 0; padding: .8rem; border-radius: 18px; background: rgba(111,99,255,.07); border: 1px solid rgba(111,99,255,.12); }
.prompt label { color: #4a3fbf; font-weight: 900; font-size: .9rem; }
textarea, input[type="text"] { width: 100%; border: 1px solid rgba(35,31,51,.13); border-radius: 16px; background: rgba(255,255,255,.92); color: var(--ink); padding: .85rem; min-height: 96px; resize: vertical; outline: none; }
textarea:focus, input:focus { border-color: rgba(111,99,255,.7); box-shadow: 0 0 0 4px rgba(111,99,255,.11); }
.slider-line { display: grid; gap: .3rem; padding: .65rem; border-radius: 16px; background: rgba(182,240,218,.18); border: 1px solid rgba(80,160,130,.12); }
.slider-line label { font-weight: 900; color: #2c765f; }
.slider-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .6rem; }
input[type="range"] { width: 100%; accent-color: var(--purple); }
.check-line { display: flex; gap: .65rem; align-items: flex-start; padding: .5rem .55rem; border-radius: 14px; background: rgba(35,31,51,.04); }
.check-line input { margin-top: .2rem; accent-color: var(--purple); }
.reader-actions { position: sticky; bottom: calc(var(--nav-h) + .7rem); display: grid; grid-template-columns: auto 1fr auto; gap: .55rem; margin-top: 1rem; padding: .6rem; background: rgba(251,248,244,.72); border: 1px solid rgba(255,255,255,.8); border-radius: 24px; backdrop-filter: blur(20px); box-shadow: 0 12px 30px rgba(44,35,70,.1); }
.lock-screen { text-align: left; padding: 1rem; border-radius: 30px; background: linear-gradient(145deg, rgba(35,31,51,.94), rgba(80,63,130,.92)); color: #fff; box-shadow: var(--shadow); }
.lock-screen p { color: rgba(255,255,255,.76); }
.lock-screen .primary-btn { background: #fff; color: var(--ink); }
.notice { background: rgba(220,238,255,.8); border: 1px solid rgba(110,140,170,.12); border-radius: 18px; padding: .85rem; color: #344357; }
.safety { background: rgba(246,198,214,.32); border-color: rgba(200,100,130,.16); }
.journal-list { display: grid; gap: .65rem; }
.entry { border-radius: 18px; padding: .8rem; background: rgba(255,255,255,.76); border: 1px solid var(--line); }
.drawer { position: fixed; inset: 0; z-index: 80; background: rgba(27,23,40,.24); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.drawer.open { opacity: 1; pointer-events: auto; }
.drawer-card { width: min(88vw, 360px); height: 100%; background: rgba(251,248,244,.96); padding: 1rem; box-shadow: 40px 0 90px rgba(22,16,35,.22); transform: translateX(-100%); transition: transform .2s ease; display: grid; align-content: start; gap: .9rem; }
.drawer.open .drawer-card { transform: translateX(0); }
.drawer-header { display: flex; gap: .75rem; align-items: center; padding: .65rem 0 .85rem; border-bottom: 1px solid var(--line); }
.drawer-header p { margin: .15rem 0 0; color: var(--muted); font-size: .88rem; }
.drawer-links { display: grid; gap: .45rem; }
.drawer-links button { text-align: left; border: 0; border-radius: 18px; padding: .9rem; background: rgba(255,255,255,.65); color: var(--ink); font-weight: 850; }
.bottom-nav { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: max(.65rem, env(safe-area-inset-bottom)); width: min(92vw, 720px); height: var(--nav-h); display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; padding: .55rem; background: rgba(255,255,255,.74); border: 1px solid rgba(255,255,255,.86); border-radius: 28px; box-shadow: 0 18px 55px rgba(44,35,70,.18); backdrop-filter: blur(24px); }
.nav-item { border: 0; background: transparent; color: var(--muted); border-radius: 20px; display: grid; place-items: center; gap: .18rem; font-weight: 850; }
.nav-item span { font-size: 1.2rem; }
.nav-item.active { background: linear-gradient(135deg, rgba(111,99,255,.15), rgba(182,240,218,.24)); color: var(--ink); }
.divider { height: 1px; background: var(--line); margin: .9rem 0; }
.hidden { display: none !important; }
@media (max-width: 560px) {
  .grid.two { grid-template-columns: 1fr; }
  .screen { padding-left: .82rem; padding-right: .82rem; }
  .topbar { padding-left: .75rem; padding-right: .75rem; }
  .brand-text small { display: none; }
  .reader-actions { grid-template-columns: 1fr 1.4fr 1fr; bottom: calc(var(--nav-h) + .55rem); }
  .reader-actions button { padding-left: .65rem; padding-right: .65rem; }
}
