*{box-sizing:border-box}

body{
  margin:0;
  background:#f4f7fb;
  color:#243044;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP",sans-serif
}

.container{max-width:860px;margin:auto;padding:20px}
header{text-align:center;margin:8px 0 20px}
header h1{margin:0 0 6px;color:#145c9e}
#appTitle{white-space:pre-wrap}

.card{
  background:#fff;
  border-radius:16px;
  padding:22px;
  margin:16px 0;
  box-shadow:0 4px 18px rgba(0,0,0,.08)
}

.hidden{display:none!important}

.tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:20px
}

.tab,.sub,.program button,.primary{
  border:0;
  border-radius:10px;
  padding:12px 16px;
  font-weight:700;
  cursor:pointer
}

.tab{background:#e8edf4}
.tab.active{background:#145c9e;color:#fff}

.primary{
  width:100%;
  background:#145c9e;
  color:#fff;
  font-size:16px;
  margin-top:16px
}

.sub{background:#eef2f6;color:#334155}

label{
  display:block;
  font-weight:700;
  margin:12px 0
}

input,select,textarea{
  display:block;
  width:100%;
  margin-top:6px;
  padding:11px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  background:#fff;
  font:inherit
}

textarea{
  min-height:90px;
  resize:vertical
}

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px
}

.note{
  font-size:13px;
  color:#64748b
}

.notice{
  padding:12px;
  border-radius:10px;
  background:#eef7ff;
  border:1px solid #9ac8ef;
  margin-top:14px
}

.notice-box{
  margin:16px 0 24px;
  padding:16px 18px;
  background:#fff8e1;
  border:1px solid #f0c36d;
  border-radius:10px
}

.notice-title{
  font-weight:700;
  margin-bottom:8px
}

.notice-text{
  white-space:pre-wrap;
  line-height:1.7
}

.grade-preview{
  padding:13px 15px;
  background:#f0f9ff;
  border:1px solid #bae6fd;
  border-radius:10px;
  margin:12px 0
}

.member-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:center
}

.member-head h2{margin:2px 0}
.member-head p{margin:5px 0;color:#64748b}

.category{
  margin-top:24px;
  padding-bottom:7px;
  border-bottom:2px solid #dbe7f3
}

.program{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  border:1px solid #dbe2ea;
  border-radius:12px;
  padding:15px;
  margin:10px 0
}

.program h3{margin:0 0 6px}
.program p{margin:4px 0}

.program button{
  background:#1769aa;
  color:#fff;
  min-width:90px
}

.program button:disabled{
  background:#cbd5e1;
  color:#64748b;
  cursor:not-allowed
}

.program.closed{background:#fafafa}

.fee{
  font-size:18px;
  font-weight:700
}

.error{color:#c62828}
.ok{color:#16803c}
.done{color:#5b21b6;font-weight:700}

.extra-box{
  background:#f8fafc;
  border:1px solid #dbe2ea;
  border-radius:12px;
  padding:14px;
  margin:12px 0
}

.applied-box{
  margin-top:20px;
  padding-top:14px;
  border-top:1px solid #e2e8f0
}

.applied-box h3{margin:0 0 8px}

.applied-item{
  display:flex;
  justify-content:space-between;
  gap:15px;
  padding:10px 0;
  border-bottom:1px solid #edf2f7
}

.applied-item small{
  display:block;
  color:#64748b;
  margin-top:3px
}

.applied-item span{
  white-space:nowrap;
  color:#64748b;
  font-size:13px
}

.complete{text-align:center}

.loading{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.46);
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center
}

.modal-box{
  width:min(310px,86vw);
  background:#fff;
  border-radius:15px;
  padding:25px;
  text-align:center;
  box-shadow:0 12px 40px rgba(0,0,0,.25)
}

.spinner{
  width:42px;
  height:42px;
  border:4px solid #d9e4ef;
  border-top-color:#145c9e;
  border-radius:50%;
  animation:spin .8s linear infinite;
  margin:0 auto 15px
}

@keyframes spin{
  to{transform:rotate(360deg)}
}

.checkbox-label{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  width:fit-content!important;
  margin:8px 0!important;
  cursor:pointer
}

.checkbox-label input[type="checkbox"]{
  width:auto!important;
  min-width:auto!important;
  flex:0 0 auto!important;
  margin:0!important
}

.checkbox-label span{
  width:auto!important;
  margin:0!important
}

.link-button{
  background:none!important;
  border:none!important;
  color:#1769aa!important;
  padding:4px!important;
  width:auto!important;
  cursor:pointer;
  text-decoration:underline;
  font-size:14px
}

.link-button:hover{opacity:.75}

@media(max-width:620px){
  .container{padding:10px}
  .card{padding:16px}
  .grid2{grid-template-columns:1fr}
  .member-head,.program,.applied-item{
    align-items:stretch;
    flex-direction:column
  }
  .program button{width:100%}
  .tabs{grid-template-columns:1fr}
  .applied-item span{white-space:normal}
}
