:root{
  --bg:#FFF1F6;
  --lav:#EDE6FF;
  --mint:#D9FFF2;
  --peach:#FFD0E3;
  --cream:#FFFDFB;
  --text:#3E2B2A;
  --line:#B38A8A;

  /* Teen vibe accents */
  --pink:#FF5FA2;
  --lilac:#B389FF;
  --butter:#FFE27A;
  --aqua:#7DE6C5;

  --shadow:0 14px 36px rgba(33, 12, 40, 0.12);
  --shadow-soft:0 10px 22px rgba(33, 12, 40, 0.09);
  --ring:rgba(255,95,162,0.28);
}
*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,214,201,0.75), transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(239,234,255,0.85), transparent 48%),
    radial-gradient(circle at 55% 90%, rgba(230,243,238,0.85), transparent 52%),
    var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

/* ===== Welcome ===== */
.welcome{min-height:100%;display:flex;align-items:center;justify-content:center;padding:18px;}
.welcome-card{
  width:min(420px,100%);
  background:rgba(255,255,255,0.72);
  border:1px solid rgba(179,138,138,0.18);
  box-shadow:var(--shadow);
  border-radius:26px;
  padding:18px 16px 16px;
  position:relative;
  overflow:hidden;
}
.welcome-badge{
  width:56px;height:56px;border-radius:18px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,245,247,0.95);
  border:1px solid rgba(179,138,138,0.18);
  box-shadow:var(--shadow-soft);
  font-size:24px;
}
.welcome-title{margin:12px 0 2px;font-family:"Playfair Display",Georgia,serif;font-weight:700;letter-spacing:.2px;}
.welcome-sub{margin:0 0 14px;opacity:.82;}
.welcome-art{position:absolute;inset:0;pointer-events:none;opacity:.7;}
.bubble{position:absolute;border-radius:999px;}
.b1{width:160px;height:160px;left:-50px;top:-50px;background:rgba(255,214,201,0.7);}
.b2{width:200px;height:200px;right:-70px;top:30px;background:rgba(239,234,255,0.75);}
.b3{width:220px;height:220px;left:70px;bottom:-90px;background:rgba(230,243,238,0.75);}
.spark{position:absolute;width:10px;height:10px;border-radius:4px;background:white;box-shadow:var(--shadow-soft);}
.s1{left:58px;top:86px;transform:rotate(12deg);}
.s2{right:72px;top:130px;transform:rotate(22deg);}
.s3{right:120px;bottom:72px;transform:rotate(-12deg);}
.washi{
  position:absolute;height:30px;width:160px;border-radius:12px;
  background:rgba(255,255,255,0.55);
  border:1px dashed rgba(179,138,138,0.22);
  box-shadow:0 10px 18px rgba(0,0,0,0.04);
}
.w1{left:22px;top:18px;transform:rotate(-6deg);}
.w2{right:20px;bottom:18px;transform:rotate(7deg);}

.form{display:grid;gap:12px;position:relative;}
.field span{display:block;font-size:12px;opacity:.85;margin:0 0 6px;}
.field input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(179,138,138,0.22);
  background:rgba(255,245,247,0.55);
  outline:none;
}
.field input:focus{box-shadow:0 0 0 4px var(--ring);border-color:rgba(179,138,138,0.55);}
.btn-primary{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(179,138,138,0.18);
  background:linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,245,247,0.86));
  box-shadow:var(--shadow-soft);
  font-weight:900;
}
.tiny-note{margin:0;font-size:11px;opacity:.75;line-height:1.35;}
.link-btn{
  margin-top:10px;width:100%;
  padding:11px 12px;border-radius:14px;
  border:1px dashed rgba(179,138,138,0.28);
  background:transparent;font-weight:800;
}

/* ===== Topbar ===== */
.topbar{
  position:sticky;top:0;z-index:50;
  background:rgba(255,245,247,0.90);
  backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(179,138,138,0.18);
  padding:12px 14px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.brand-title{font-weight:900;letter-spacing:.2px;}
.brand-sub{font-size:12px;opacity:.8;margin-top:2px;}
.btn{
  border:1px solid rgba(179,138,138,0.28);
  background:rgba(255,255,255,0.9);
  color:var(--text);
  padding:10px 12px;border-radius:14px;
  box-shadow:var(--shadow-soft);
  font-weight:800;
}
.top-actions{display:flex;gap:8px;}

/* ===== Layout ===== */
.app{
  display:grid;
  grid-template-columns:minmax(0,1fr) 170px;
  gap:12px;
  padding:14px;
  max-width:960px;
  margin:0 auto;
}
.canvas-wrap{display:flex;justify-content:center;}
.page{
  position:relative;
  width:min(560px,100%);
  padding:18px 16px 56px;
  border-radius:26px;
  background:rgba(255,255,255,0.62);
  border:1px solid rgba(179,138,138,0.16);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.page.pretty::before{
  content:"";
  position:absolute;inset:0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,214,201,0.35), transparent 46%),
    radial-gradient(circle at 92% 28%, rgba(239,234,255,0.35), transparent 46%),
    radial-gradient(circle at 50% 96%, rgba(230,243,238,0.35), transparent 52%);
  pointer-events:none;
}
.page > *{ position:relative; z-index:1; }

.page-header{text-align:center;margin:4px 0 12px;}
.page-kicker{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:11px;
  letter-spacing:.5px;
  text-transform:uppercase;
  background:rgba(239,234,255,0.7);
  border:1px solid rgba(179,138,138,0.14);
}
.date-input{
  width:100%;
  margin:10px 0 4px;
  padding:12px 14px;
  border-radius:18px;
  border:1px dashed rgba(179,138,138,0.28);
  background:rgba(255,245,247,0.55);
  font-family:"Playfair Display", Georgia, serif;
  font-weight:650;
  font-size:22px;
  text-align:center;
  outline:none;
}
.date-input:focus{ box-shadow:0 0 0 5px var(--ring); border-color: rgba(179,138,138,0.55); }
.subtitle{margin:6px 0 0;opacity:.82;}

.tier{
  background:rgba(255,255,255,0.88);
  border-radius:20px;
  padding:12px;
  margin-bottom:12px;
  border:1px solid rgba(179,138,138,0.12);
  box-shadow:0 6px 16px rgba(0,0,0,0.04);
  padding-right: 78px; /* reserve for tabs */
}
.tier h2,.tier h3{margin:0 0 8px;font-weight:900;}
.tier h2{font-size:15px;}
.tier h3{font-size:13px;opacity:.92;}

textarea{
  width:100%;
  min-height:86px;
  border:1px dashed rgba(179,138,138,0.24);
  border-radius:16px;
  padding:12px 12px;
  background:rgba(255,245,247,0.34);
  color:var(--text);
  resize:none;
  outline:none;
}
textarea:focus{box-shadow:0 0 0 5px var(--ring);border-color:rgba(179,138,138,0.55);}

.split{display:flex;gap:10px;}
.box{flex:1;}

.plan-row{
  display:flex;gap:10px;align-items:center;
  padding:10px 10px;
  border-radius:16px;
  border:1px solid rgba(179,138,138,0.12);
  background:rgba(230,243,238,0.35);
  margin-bottom:8px;
}
.plan-input{
  width:100%;
  border:none;
  background:transparent;
  outline:none;
  font-weight:750;
  color:var(--text);
}
.plan-input::placeholder{opacity:.75;}
.planner input[type="checkbox"]{accent-color:rgba(179,138,138,0.85); transform: scale(1.05);}

/* Sticker tray */
.tray{
  position:sticky;top:70px;align-self:start;
  border-radius:20px;
  background:rgba(255,255,255,0.72);
  border:1px solid rgba(179,138,138,0.16);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.tray-head{padding:12px 12px 10px;border-bottom:1px solid rgba(179,138,138,0.10);}
.tray-title{font-weight:950;}
.tray-hint{font-size:12px;opacity:.7;margin-top:2px;}
.tray-grid{padding:10px;display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.tray-item{
  border-radius:16px;
  background:rgba(255,255,255,0.95);
  border:1px solid rgba(179,138,138,0.14);
  box-shadow:0 6px 14px rgba(0,0,0,0.05);
  padding:8px;
  display:flex;align-items:center;justify-content:center;
  touch-action:none;user-select:none;
}
.tray-item img{width:56px;height:56px;display:block;pointer-events:none;}
.tray-foot{padding:10px 12px 12px;border-top:1px solid rgba(179,138,138,0.10);}
.tip{font-size:11px;opacity:.75;line-height:1.3;}

/* Sticker stage */
.sticker-stage{position:absolute;inset:0;z-index:20;pointer-events:none;}
.placed{
  position:absolute;width:120px;height:120px;
  transform-origin:center center;
  pointer-events:auto;touch-action:none;user-select:none;
}
.placed img{width:100%;height:100%;display:block;}
.placed.selected{outline:2px dashed rgba(179,138,138,0.8);outline-offset:6px;border-radius:18px;}
.handle{
  position:absolute;width:18px;height:18px;border-radius:10px;
  background:white;border:2px solid rgba(179,138,138,0.8);
  box-shadow:var(--shadow-soft);
  display:none;
}
.placed.selected .handle{display:block;}
.handle.br{right:-10px;bottom:-10px;}
.handle.tr{right:-10px;top:-10px;}
.handle.rotate{left:50%;top:-34px;transform:translateX(-50%);}
.handle.rotate::after{content:"";position:absolute;left:50%;top:18px;width:2px;height:16px;background:rgba(179,138,138,0.6);transform:translateX(-50%);}
.badge-x{
  position:absolute;left:-12px;top:-12px;
  width:24px;height:24px;border-radius:12px;
  background:white;border:2px solid rgba(179,138,138,0.8);
  box-shadow:var(--shadow-soft);
  display:none;align-items:center;justify-content:center;font-weight:900;
}
.placed.selected .badge-x{display:flex;}

/* Divider tabs (emoji-based) */
.dividers{
  position:absolute;
  top: 128px;
  right: -6px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index:30;
}
.tab{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px 10px 10px;
  border-radius:18px 0 0 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,245,247,0.86));
  border:1px solid rgba(179,138,138,0.16);
  box-shadow:0 10px 20px rgba(0,0,0,0.06);
  color:var(--text);
  text-decoration:none;
  font-weight:950;
  min-width: 132px;
}
.tab:hover{ transform: translateX(-2px); transition: transform .12s ease; }
.tab-emoji{ font-size: 18px; line-height: 1; }
.tab-text{ font-size: 12px; letter-spacing: .2px; }

/* Mobile divider bar */
.dividers-mobile{
  position:absolute;left:12px;right:12px;bottom:12px;
  border-radius:18px;
  background:rgba(255,255,255,0.92);
  border:1px solid rgba(179,138,138,0.16);
  box-shadow:var(--shadow-soft);
  display:none;align-items:center;justify-content:space-around;
  padding:10px 10px;
  z-index:35;
}
.dividers-mobile a{text-decoration:none;font-size:18px;}

/* Responsive */
@media (max-width: 780px){
  .app{grid-template-columns:1fr;}
  .tray{position:relative;top:0;}
  .dividers{display:none;}
  .dividers-mobile{display:flex;}
  .tier{ padding-right: 12px; }
  .split{ flex-direction: column; }
}


/* ===== Planner navigation ===== */
.planner-nav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:center;
  margin: 6px 0 14px;
}
.pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(179,138,138,0.16);
  background:rgba(255,255,255,0.88);
  box-shadow:0 6px 14px rgba(0,0,0,0.05);
  color:var(--text);
  text-decoration:none;
  font-weight:900;
  font-size:12px;
}
.pill.active{
  background:rgba(239,234,255,0.85);
  border-color:rgba(179,138,138,0.24);
}
.table-grid{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:18px;
  border:1px solid rgba(179,138,138,0.14);
  background:rgba(255,255,255,0.9);
}
.table-grid th, .table-grid td{
  border-bottom:1px solid rgba(179,138,138,0.12);
  border-right:1px solid rgba(179,138,138,0.08);
  padding:10px;
  vertical-align:top;
}
.table-grid th:last-child, .table-grid td:last-child{border-right:none;}
.table-grid tr:last-child td{border-bottom:none;}
.cell-input{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  min-height:54px;
  font-weight:650;
  color:var(--text);
}
.cell-input::placeholder{opacity:.6;}
.small{font-size:12px; opacity:.8;}


/* Extra teen sparkle */
.page::before{
  content:"";
  position:absolute; inset:-1px;
  border-radius:26px;
  pointer-events:none;
  background:
    radial-gradient(240px 160px at 20% 20%, rgba(255,95,162,0.10), transparent 60%),
    radial-gradient(220px 140px at 85% 25%, rgba(179,137,255,0.10), transparent 60%),
    radial-gradient(240px 160px at 35% 85%, rgba(255,226,122,0.10), transparent 60%);
  mix-blend-mode: multiply;
}
.badge{ border-color: rgba(255,95,162,0.22); }


/* Weekly notebook paper vibes */
.notebook{
  background:
    linear-gradient(rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
    repeating-linear-gradient(
      to bottom,
      rgba(179,137,255,0.10) 0px,
      rgba(179,137,255,0.10) 1px,
      transparent 1px,
      transparent 28px
    );
  border:1px solid rgba(179,137,255,0.16);
}
.notebook .tier textarea{
  background: rgba(255,255,255,0.45);
}
