:root{
  --bg:#f5f5f7;
  --surface:#ffffff;
  --surface-soft:#fafafa;
  --text:#1d1d1f;
  --muted:#6e6e73;
  --line:#e5e5ea;
  --accent:#6f5ce7;
  --accent-dark:#5846c7;
  --accent-soft:#f0edff;
  --blue-soft:#edf5ff;
  --success:#34c759;
  --danger:#ff3b30;
  --shadow:0 8px 28px rgba(0,0,0,.07);
}
*{box-sizing:border-box}
html{background:var(--bg)}
body{
  margin:0;
  min-height:100vh;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
}
button,input,textarea{font:inherit}
button{cursor:pointer}
.app{
  width:min(100%,520px);
  min-height:100vh;
  margin:0 auto;
  background:var(--bg);
  position:relative;
  padding-bottom:104px;
}
.topbar{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 18px 13px;
  background:rgba(245,245,247,.88);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  border-bottom:1px solid rgba(229,229,234,.78);
}
.wordmark{
  display:flex;
  align-items:center;
  font-family:"Nunito",-apple-system,BlinkMacSystemFont,"SF Pro Display","Helvetica Neue",Arial,sans-serif;
  font-size:30px;
  font-weight:900;
  letter-spacing:-1.8px;
  line-height:1;
  color:#1d1d1f;
  user-select:none;
}
.avatar{
  width:38px;height:38px;border-radius:50%;
  display:grid;place-items:center;
  background:var(--accent-soft);
  color:var(--accent-dark);
  font-weight:800;
}
.page{
  display:none;
  padding:20px 16px 12px;
}
.page.active{display:block}
.greeting{
  margin:2px 2px 22px;
}
.greeting h1{
  margin:0 0 5px;
  font-family:Georgia,"Times New Roman",serif;
  font-size:34px;
  line-height:1.05;
  letter-spacing:-1.3px;
}
.greeting p{margin:0;color:var(--muted);font-size:15px;line-height:1.45}
.section-title{
  margin:25px 4px 10px;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  letter-spacing:.06em;
  text-transform:uppercase;
}
.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
  padding:17px;
  margin-bottom:12px;
  box-shadow:0 2px 10px rgba(0,0,0,.035);
}
.card.featured{
  border-color:#dfd8ff;
  box-shadow:0 8px 28px rgba(111,92,231,.10);
}
.card-head{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.icon{
  width:44px;height:44px;flex:0 0 44px;
  border-radius:14px;
  display:grid;place-items:center;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:21px;
}
.icon.blue{background:var(--blue-soft)}
.card h2,.card h3{margin:0}
.card h2{
  font-family:Georgia,"Times New Roman",serif;
  font-size:22px;
  line-height:1.12;
  letter-spacing:-.45px;
}
.card h3{font-size:16px;line-height:1.25}
.card p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}
.date{
  display:inline-block;
  margin-top:5px;
  color:var(--accent-dark);
  font-size:13px;
  font-weight:750;
}
.assistant{
  margin:15px 0 0;
  font-size:15px;
  line-height:1.48;
}
.teacher-list{
  margin-top:16px;
  border-top:1px solid var(--line);
}
.teacher-group{
  --kid:#6f5ce7;
  position:relative;
  padding:18px 0 18px 14px;
  border-bottom:1px solid var(--line);
}
.teacher-group::before{
  content:"";
  position:absolute;
  left:0;
  top:18px;
  bottom:18px;
  width:4px;
  border-radius:99px;
  background:var(--kid);
}
.teacher-group:last-child{
  border-bottom:0;
  padding-bottom:4px;
}
.teacher-name{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.teacher-name h3{
  font-size:17px;
  line-height:1.25;
}
.teacher-context{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
}
.kid-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--kid);
}
.preview-favorites{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.favorite-preview{
  min-width:0;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f7f7f9;
}
.favorite-preview .category{
  display:block;
  margin-bottom:3px;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  letter-spacing:.045em;
  text-transform:uppercase;
}
.favorite-preview .value{
  display:block;
  overflow:hidden;
  color:var(--text);
  font-size:12px;
  font-weight:700;
  line-height:1.3;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.teacher-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin-top:11px;
}
.teacher-actions .btn{
  padding:8px 10px;
  font-size:12px;
}
.teacher-details{
  display:none;
  margin-top:13px;
  padding:13px;
  border-radius:16px;
  background:#f7f7f9;
  border:1px solid var(--line);
}
.teacher-details.open{display:block}
.detail-category + .detail-category{margin-top:12px}
.detail-category strong{
  display:block;
  margin-bottom:6px;
  color:var(--muted);
  font-size:10px;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.detail-items{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.detail-item{
  display:inline-flex;
  padding:7px 9px;
  border:1px solid #e3e3e8;
  border-radius:999px;
  background:#fff;
  color:var(--text);
  font-size:11px;
  font-weight:650;
}
.gift-ideas{
  display:none;
  margin-top:11px;
  padding:12px;
  border-radius:15px;
  background:#f3f1ff;
  color:var(--text);
  font-size:12px;
  line-height:1.5;
}
.gift-ideas.open{display:block}
.gift-ideas strong{
  display:block;
  margin-bottom:4px;
  color:var(--accent-dark);
}
.label{
  margin-top:16px;
  font-size:11px;
  font-weight:800;
  color:var(--muted);
  letter-spacing:.055em;
  text-transform:uppercase;
}
.chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}
.chip{
  display:inline-flex;
  align-items:center;
  padding:8px 11px;
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent-dark);
  font-size:12px;
  font-weight:700;
}
.reason{
  margin-top:12px;
  padding:10px 11px;
  border-radius:13px;
  background:var(--surface-soft);
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}
.btn{
  border:0;
  border-radius:13px;
  padding:10px 13px;
  font-weight:750;
  transition:.16s ease;
}
.btn:active{transform:scale(.98)}
.btn.primary{background:var(--accent);color:#fff}
.btn.secondary{background:var(--accent-soft);color:var(--accent-dark)}
.btn.neutral{background:#f1f1f3;color:var(--text)}
.btn.text{background:transparent;color:var(--accent);padding-left:4px;padding-right:4px}
.empty{
  padding:34px 18px;
  text-align:center;
  color:var(--muted);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
}

.inbox-group{margin:0 0 24px}
.inbox-group-title{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 4px 9px;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.inbox-group-title::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--kid,#6f5ce7);
}
.inbox-list{
  overflow:hidden;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:0 2px 10px rgba(0,0,0,.035);
}
.inbox-row{
  width:100%;
  display:grid;
  grid-template-columns:58px 1fr 22px;
  gap:12px;
  align-items:center;
  padding:12px;
  border:0;
  border-bottom:1px solid var(--line);
  background:transparent;
  color:var(--text);
  text-align:left;
}
.inbox-row:last-child{border-bottom:0}
.inbox-row:active{background:#f3f3f5}
.inbox-thumb{
  width:58px;
  height:58px;
  object-fit:cover;
  border-radius:13px;
  border:1px solid var(--line);
  background:#f2f2f7;
}
.inbox-thumb.placeholder{
  display:grid;
  place-items:center;
  color:var(--accent);
  font-size:22px;
}
.inbox-title{
  overflow:hidden;
  font-size:15px;
  font-weight:750;
  line-height:1.25;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.inbox-meta{
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}
.inbox-chevron{
  color:#aeaeb2;
  font-size:22px;
  text-align:right;
}
.sheet-backdrop{
  position:fixed;
  inset:0;
  z-index:80;
  display:none;
  align-items:flex-start;
  justify-content:center;
  padding:calc(18px + env(safe-area-inset-top)) 10px calc(18px + env(safe-area-inset-bottom));
  background:rgba(0,0,0,.28);
  backdrop-filter:blur(5px);
  -webkit-backdrop-filter:blur(5px);
}
.sheet-backdrop.open{display:flex}
.detail-sheet{
  width:min(100%,500px);
  max-height:88vh;
  overflow:auto;
  padding:14px 16px 20px;
  border-radius:28px;
  background:#fff;
  box-shadow:0 28px 80px rgba(0,0,0,.22);
}
.sheet-handle{
  width:38px;
  height:5px;
  margin:0 auto 14px;
  border-radius:99px;
  background:#d1d1d6;
}
.sheet-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.sheet-top h2{
  margin:0;
  font-family:Georgia,"Times New Roman",serif;
  font-size:26px;
  letter-spacing:-.5px;
}
.sheet-close{
  width:32px;
  height:32px;
  border:0;
  border-radius:50%;
  background:#f1f1f3;
  color:var(--muted);
  font-size:18px;
}
.sheet-image{
  width:100%;
  max-height:310px;
  object-fit:contain;
  margin-top:16px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#f7f7f9;
}
.sheet-section{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--line);
}
.sheet-section h3{
  margin:0 0 10px;
  color:var(--muted);
  font-size:11px;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.sheet-facts{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
}
.sheet-fact{
  padding:11px;
  border-radius:14px;
  background:#f7f7f9;
}
.sheet-fact span{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.sheet-fact strong{
  display:block;
  margin-top:3px;
  font-size:13px;
}
.upload-card{
  padding:25px 18px;
  text-align:center;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:var(--shadow);
}
.upload-icon{
  width:54px;height:54px;
  margin:0 auto 12px;
  border-radius:17px;
  display:grid;place-items:center;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:30px;
}
.upload-card h2{
  margin:0 0 5px;
  font-family:Georgia,"Times New Roman",serif;
  font-size:25px;
  letter-spacing:-.55px;
}
.upload-card p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}
#file{display:none}
#preview{
  display:none;
  width:100%;
  max-height:260px;
  object-fit:contain;
  margin-top:16px;
  border-radius:16px;
  border:1px solid var(--line);
  background:#fff;
}
.status{
  display:none;
  text-align:left;
  margin-top:14px;
  padding:14px;
  border-radius:16px;
  background:var(--surface-soft);
  border:1px solid var(--line);
}
.status strong{font-size:14px}
.steps{display:grid;gap:7px;margin-top:10px}
.steps span{font-size:12px;color:#a1a1a6}
.steps span.active{color:var(--accent);font-weight:750}
.bar{height:6px;margin-top:12px;border-radius:99px;background:#e9e9ed;overflow:hidden}
.bar span{display:block;width:0;height:100%;background:var(--accent);transition:.8s}
#reviewForm{display:none}
.review-title{
  margin:20px 2px 10px;
}
.review-title h2{
  margin:0;
  font-family:Georgia,"Times New Roman",serif;
  font-size:27px;
  letter-spacing:-.7px;
}
.review-title p{margin:4px 0 0;color:var(--muted);font-size:13px}
.form-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
  padding:16px;
  margin-bottom:12px;
}
.form-card-head{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:12px;
}
.form-card-head .icon{width:40px;height:40px;flex-basis:40px}
.form-card-head h3{margin:0;font-size:16px}
.form-card-head p{margin:2px 0 0;font-size:12px;color:var(--muted)}
.field{margin-top:10px}
.field:first-of-type{margin-top:0}
.field label{
  display:block;
  margin:0 0 6px;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.input{
  width:100%;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--surface-soft);
  color:var(--text);
  outline:none;
}
.input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(111,92,231,.13);
  background:#fff;
}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.promise{
  display:flex;
  gap:11px;
  padding:15px;
  border-radius:18px;
  background:var(--accent-soft);
  color:var(--accent-dark);
  font-size:13px;
  line-height:1.45;
}
.promise strong{display:block;margin-bottom:3px}
.search-box{
  display:flex;
  gap:8px;
  padding:5px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 2px 10px rgba(0,0,0,.035);
}
.search-box input{
  flex:1;
  border:0;
  outline:none;
  background:transparent;
  padding:10px;
  min-width:0;
}
.answer{margin-top:12px}
.bottom-nav{
  position:fixed;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  z-index:40;
  width:min(100%,520px);
  display:grid;
  grid-template-columns:repeat(4,1fr);
  padding:9px 8px calc(10px + env(safe-area-inset-bottom));
  background:rgba(250,250,252,.92);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
  border-top:1px solid rgba(229,229,234,.9);
}
.nav-btn{
  border:0;
  background:transparent;
  color:#8e8e93;
  padding:5px 2px 2px;
  font-size:10px;
  font-weight:700;
}
.nav-icon{
  display:grid;
  place-items:center;
  width:29px;height:29px;
  margin:0 auto 3px;
  border-radius:10px;
  font-size:20px;
  line-height:1;
}
.nav-btn.active{color:var(--accent)}
.nav-btn.active .nav-icon{background:var(--accent-soft)}
.toast{
  position:fixed;
  left:50%;
  bottom:91px;
  transform:translate(-50%,20px);
  z-index:60;
  opacity:0;
  padding:11px 15px;
  border-radius:999px;
  background:#1d1d1f;
  color:#fff;
  font-size:13px;
  font-weight:750;
  transition:.22s;
}
.toast.show{opacity:1;transform:translate(-50%,0)}
@media(min-width:700px){
  body{padding:24px 0}
  .app{
    min-height:calc(100vh - 48px);
    border:1px solid #dddde2;
    border-radius:34px;
    overflow:hidden;
    box-shadow:0 28px 80px rgba(0,0,0,.13);
  }
  .bottom-nav{
    bottom:24px;
    border-radius:0 0 34px 34px;
  }
}
@media(max-width:420px){
  .two-col{grid-template-columns:1fr}
  .page{padding-left:13px;padding-right:13px}
}
